Skip to content

Commit

Permalink
fix function parse_conversions(page_data, options)
Browse files Browse the repository at this point in the history
  • Loading branch information
kanasimi committed Jan 19, 2025
1 parent 94d63d9 commit b1e07cb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions application/net/wiki/template_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,25 @@ function module_code(library_namespace) {
object = object.replace(
/(?:\w* )*function Item\s*\([\s\S]+?[\n ]end *\n/, '')
.replace(/local\s+Item\s*=[^\n;]+/, '');

/**
* e.g., [[w:zh:Module:CGroup/NBA]] <code>
Item('Oklahoma City Thunder',
--
''..
''..
--
''..
''
),
</code>
*/
object = object.replace(
/(['"])\s*(?:--.*\n\s*)*\.\.\s*(?:--.*\n\s*)*\1/g, '');
object = object.replace(/,\s*(?:--.*\n\s*)*(['"])/g, ',$1');

// convert `Item('Alec', 'zh-cn:亚历克; zh-tw:亞歷;')`
object = object.replace(PATTERN_Item_function, function(item,
prefix, original, rule, additional) {
Expand Down

0 comments on commit b1e07cb

Please sign in to comment.