Skip to content

Comments

Fix update last preserve html newlines#886

Merged
killergerbah merged 2 commits intokillergerbah:mainfrom
L-M-Sherlock:fix-update-last-preserve-html-newlines
Feb 17, 2026
Merged

Fix update last preserve html newlines#886
killergerbah merged 2 commits intokillergerbah:mainfrom
L-M-Sherlock:fix-update-last-preserve-html-newlines

Conversation

@L-M-Sherlock
Copy link
Contributor

@L-M-Sherlock L-M-Sherlock commented Feb 16, 2026

Problem:

  • When updateLastCard runs, multiline field values are converted from \n to <br>.
  • Yomitan definitions include HTML (e.g., <style> blocks).
  • The conversion breaks CSS inside <style>, producing <br> between CSS rules.

Fix:

  • Detect HTML content in field values and skip newline-to-<br> conversion for those values.
  • Plain-text multiline fields are still converted to <br> as before.

Before:

image

After:

image

@L-M-Sherlock L-M-Sherlock force-pushed the fix-update-last-preserve-html-newlines branch from 4952514 to ac9add0 Compare February 16, 2026 17:27
@killergerbah
Copy link
Owner

So basically, "if already HTML do not try to convert to HTML"
I think that makes sense, just slightly worried about unintended side effects. HTML can be inherited by the subtitle farther up in the file but this should only be coming from Yomitan, which should have inserted the breaklines already anyway.

@killergerbah killergerbah added this to the Extension v1.14.0 milestone Feb 17, 2026
@killergerbah killergerbah merged commit 0227734 into killergerbah:main Feb 17, 2026
1 check passed
@L-M-Sherlock L-M-Sherlock deleted the fix-update-last-preserve-html-newlines branch February 18, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants