Skip to content

Commit

Permalink
fix(text selection): handling newlines (fix #185)
Browse files Browse the repository at this point in the history
  • Loading branch information
camarm-dev committed Jun 16, 2024
1 parent 2996e8f commit bdc6a76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected void onCreate(Bundle savedInstanceState) {
Uri page;
boolean endProcess;
if (text.toString().contains(" ") && text.charAt(0) != 'à') {
page = Uri.parse(getResources().getString(R.string.custom_url_scheme) + "://correction?data=" + text + "&readonly=" + readonlyArg);
page = Uri.parse(getResources().getString(R.string.custom_url_scheme) + "://correction?data=" + text.toString().replaceAll("\n", "<newline>") + "&readonly=" + readonlyArg);
endProcess = false;
} else {
page = Uri.parse(getResources().getString(R.string.custom_url_scheme) + "://dictionnaire/" + text.toString().toLowerCase() + "?close=true");
Expand Down
2 changes: 1 addition & 1 deletion app/src/views/CorrectionPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export default {
const readonly = url.get("readonly")
if (data) {
const content = data
this.content = content
this.content = content.replaceAll("<newline>", "\n")
if (content != "") {
this.openedFromSelection = true
this.textSelectionReadOnly = readonly ? readonly == "true": false
Expand Down

0 comments on commit bdc6a76

Please sign in to comment.