feedback icon indicating copy to clipboard operation
feedback copied to clipboard

Escaped Markdown Changed

Open Farrser opened this issue 4 years ago • 1 comments

Summary

Escaped text loses its escape character when imported in to gitlocalize. We use formatting such as \<This\> for custom formatting of buttons in our software.

Steps to reproduce

  1. Create a markdown file with some content escaped. For example \(This\), \<This\>, \[This\] or \{This\}.
  2. Import the project into git localize
  3. Notice that the backlashes are missing in both the source and destination files as shown in the git localize UI
  4. Attempt to translate the string anyway and submit a PR
  5. The escape character is missing.

Repository URL

https://github.com/AvolitesLtd/TitanManual

What is the current bug behavior?

The escape characters are removed

What is the expected correct behavior?

The string with the escaped characters shown

Relevant logs and/or screenshots

To help you find buttons and controls:
- \<This\> indicates a physical buttons on the console *(or \<Avo\> for red keys)*
- \[This\] indicates a softkey menu option on the touchscreen
- \{This\} indicates an option in a context menu or a general touch button on the screen

image

https://manual.avolites.com/docs/en/introduction/

https://github.com/AvolitesLtd/TitanManual/blob/master/docs/introduction.md (View the raw file, not the github formatted one)

Possible fixes

Don't pre format the markdown in the git localize interface. Show the raw markdown instead and allow the translator to ensure the markdown is formatted correctly.

Farrser avatar Feb 19 '21 16:02 Farrser

Thanks for reporting this @Farrser It looks like the problem here is that we're basically using the same markdown parser as Github does. While Github 'removes' the backslash to correctly display the escaped character when rendering the page (which is normal), we are removing the backslash in the same manner, which leads to unescaped characters in the target file. We have added this to our roadmap. While we're working on this, is there any way you can apply html-style escaping e.g. using &lt; instead of \< ?

Thanks!

ilyaspiridonov avatar Feb 19 '21 18:02 ilyaspiridonov