vslavik / poedit

Translations editor for Mac, Windows and Unix
https://poedit.net
MIT License
1.71k stars 274 forks source link

False positive Broken markup in translation string warning with HTML #832

Closed moritz89 closed 5 months ago

moritz89 commented 5 months ago

The following translation results in the "Broken markup in translation string" warning. Looking at POedit sources, it seems to parse this as XML? Would it be sensible to handle the case where HTML is used in the translation?

Additional details can be found on the <a href="https://github.com/..." target="_blank" rel="noopener"> GitHub page.</a>
vslavik commented 5 months ago

Please read this document, follow the instructions therein and provide the missing detailed information, including any files necessary to reproduce and detailed, specific steps to reproduce. Thanks!

POedit

BTW, why do you use this bizarre mis-spelling of Poedit's name?

moritz89 commented 5 months ago

It turned out to be a problem in the PO files themselves. They were generated by Angular and included source tags such as

<source> Install and start the Snap package. For the self-contained binary, older versions and other platforms see the <x id="START_LINK" ctype="x-a" equiv-text="&lt;a                   href=&quot;https://github.com/InamataCo/Flasher/releases/latest&quot;                   target=&quot;_blank&quot;                   rel=&quot;noopener&quot;                 >"/> GitHub releases page. <x id="CLOSE_LINK" ctype="x-a" equiv-text="&lt;/a>"/></source>

This understandably confused Poedit and resulted in weird behavior. Will fix it in the source text to not include HTML tags. I assumed the name from seeing POEditor.