Skip to content

Commit

Permalink
Merge pull request #6 from boyan01/main
Browse files Browse the repository at this point in the history
fix flutter generate string with double quotes.
  • Loading branch information
Tougee authored Sep 5, 2024
2 parents 79e5d23 + 880f15f commit 26553a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/kotlin/one/mixin/handsaw/generate.kt
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,7 @@ class FlutterGenerator : Generator {
(androidPlaceHolder.findAll(value) + iosPlaceHolder.findAll(value)).forEachIndexed { index, matchResult ->
value = value.replace(matchResult.value, "{arg$index}")
}
value.replace("\n", "\n")
.replace(twoStar, "")

value = value.replace("\"", "\\\"")
value.trim()
}

Expand Down
1 change: 1 addition & 0 deletions src/test/resources/xmldir/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
<string name="test_ios_authentication" platform="iosAuthentication">test iOS authentication</string>
<string name="test_app_store" platform="appStore">test iOS AppStore</string>
<string name="Hour" platform="android,ios,desktop">%d Hour</string>
<string name="string_with_double_quotes" platform="desktop">"test"</string>
</resources>

0 comments on commit 26553a6

Please sign in to comment.