Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion core/src/main/resources/templatetransform.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,19 @@
},
"Lang":{
"transformer":"textNode",
"replace": "<br />$(3||)<br />"
"replace": "$(2||)"
},
"Native name|native_name":{
"transformer":"textNode",
"replace": "$(2||)"
},
"Nihongo2":{
"transformer":"textNode",
"replace": "$(1||)"
},
"Nihongo":{
"transformer":"textNode",
"replace": "$(2||)"
},
"Marriage":{
"transformer":"extractChildren",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ class TemplateTransformParserTest extends FlatSpec with Matchers
parse("en", "{{url|https://www.dji.com DJI.com}}") should be (Some("[https://www.dji.com]"))
}

it should "extract text from {{lang|nap|Abbrùzzu}}" in
{
parse("en", "{{lang|nap|Abbrùzzu}}") should be (Some("Abbrùzzu"))
}

it should "extract text from {{native name|nap|Abbrùzze}}" in
{
parse("en", "{{native name|nap|Abbrùzze}}") should be (Some("Abbrùzze"))
}

it should "extract text from {{Nihongo2|東京都}}" in
{
parse("en", "{{Nihongo2|東京都}}") should be (Some("東京都"))
}

it should "extract text from {{Nihongo|Tokyo|東京|Tōkyō}}" in
{
parse("en", "{{Nihongo|Tokyo|東京|Tōkyō}}") should be (Some("東京"))
}


private val wikiParser = WikiParser.getInstance()

Expand Down
Loading