Skip to content
Merged
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
26 changes: 25 additions & 1 deletion core/src/main/resources/templatetransform.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,31 @@
},
"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||)"
},
"Langx":{
"transformer":"textNode",
"replace": "$(2||)"
},
"Script":{
"transformer":"textNode",
"replace": "$(2||)"
},
"Transliteration":{
"transformer":"textNode",
"replace": "$(2||)"
},
"Marriage":{
"transformer":"extractChildren",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,41 @@ 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("東京"))
}

it should "extract text from {{Script|Arab|أبجدية عربية}}" in
{
parse("en", "{{Script|Arab|أبجدية عربية}}") should be (Some("أبجدية عربية"))
}

it should "extract text from {{Transliteration|ru|Moskva}}" in
{
parse("en", "{{Transliteration|ru|Moskva}}") should be (Some("Moskva"))
}

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


private val wikiParser = WikiParser.getInstance()

Expand Down
Loading