themoeway / yomitan

Japanese pop-up dictionary browser extension. Successor to Yomichan.
https://chromewebstore.google.com/detail/yomitan/likgccmbimhjbgkjambclfkhldnlhbnn
GNU General Public License v3.0
989 stars 76 forks source link

`\n` in the `dictionaryEntry` is rendered as `&lt;br&gt` instead of `<br>` #778

Closed BilderLoong closed 4 months ago

BilderLoong commented 4 months ago

Description The template rendered results for \n is &lt;br&gt instead of <br>.

image

Reproduce

Yomitan Info

Extension version: Yomitan (development build) 24.2.26.0
Platform: Mac OS
Browser: Chrome
Language: fr
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
AnkiConnect version: Unknown (Anki not running or connected)
Installed dictionaries: JMdict Extra, 研究社 新和英大辞典 第5版, BCCWJ-LUW, CC100, Youtube, 日本語文法辞典(全集), 絵でわかる日本語, 毎日のんびり日本語教師, どんなときどう使う 日本語表現文型辞典, JLPT文法解説まとめ, 語源由来辞典, Pixiv, デジタル大辞泉, 三省堂国語辞典 第八版, 大辞林 第四版, 実用日本語表現辞典, 岩波国語辞典 第八版, 広辞苑 第七版, 故事ことわざの辞典, 新明解国語辞典 第八版, 旺文社国語辞典 第十一版, 明鏡国語辞典 第二版, 複合語起源, アクセント辞典, kty-de-de-ipa, kty-de-de, kty-de-en-ipa, kty-de-fr-ipa, kty-de-fr, kty-de-ipa, kty-de-zh-ipa, kty-de-zh, kty-en-en-ipa, kty-en-fr-ipa, kty-en-fr, kty-en-zh-ipa, kty-en-zh, kty-fr-de-ipa, kty-fr-de, kty-fr-en-ipa, kty-fr-en, kty-fr-fr-ipa, kty-fr-fr, kty-fr-ipa, kty-fr-zh-ipa, kty-fr-zh, kty-ja-de-ipa, kty-ja-de, kty-ja-en-ipa, kty-ja-en, kty-ja-fr, kty-ja-ipa, kty-ja-zh-ipa, kty-ja-zh, kty-en-en, kty-en-de-ipa, kty-en-de, Jitendex.org [2024-02-25], Vicon Ger to Eng, yzk-freq-en-v3, yzk-freq-de-v3, kty-de-en, yzk-freq-fr-v3, Vicon Eng to Fre, Vicon Eng to Ger, Vicon Eng to Jp, Vicon Eng to Trad Chi, Vicon Fre to Eng, Wordset, seth-oald-extra, yzk-freq-en, seth-oald-ipa, 和独大辞典, JA Wikipedia [2022-12-01] (v1.4.0)

Exported settings file Allemand profile in yomitan-settings-2024-03-14-03-38-35.json

Kuuuube commented 4 months ago

Duplicate of #682. Already fixed in master.

BilderLoong commented 4 months ago

Duplicate of #682. Already fixed in master.

I tried master, and I can still reproduce this issue. I also try to debug the code a little bit. I found that the below code escapes the <br>:

image

The handlebar and yomitan-handlebars versions that I installed locally are:

├── handlebars@4.7.8
└── yomitan-handlebars@npm:@kbn/handlebars@1.0.0 (git+ssh://git@github.com/themoeway/yomitan-handlebars.git#12aff5e3550954d7d3a98a5917ff7d579f3cce25)
Kuuuube commented 4 months ago

Can't replicate. Could you provide the dictionary you're using? It also isn't likely to be considered acceptable to remove escaping entirely due to security issues.

BilderLoong commented 4 months ago

Can't replicate. Could you provide the dictionary you're using? It also isn't likely to be considered acceptable to remove escaping entirely due to security issues.

Here is the dictionary that contains the \n in the definition. @Kuuuube Vicon_Ger_to_Eng_Dictionary.zip

BilderLoong commented 4 months ago

I found out why I have this issue! My master code only contains the #722 but is missing the #732 after using the most updated data master code. I have no problem now.