Skip to content

Conversation

@arthrod
Copy link

@arthrod arthrod commented Jan 9, 2026

Summary

  • Adds <ins> tag support with underline formatting (same as <u>)
  • Adds <mark> tag support with yellow background highlight

Background

These HTML5 semantic elements are commonly used in:

  • Markdown-to-HTML converters (e.g., ==highlight==<mark>)
  • Document editing and track changes
  • Text comparison tools

<ins> - Insertion

The <ins> element represents text that has been added to a document. Per HTML convention, it's typically rendered with underline, same as <u>.

Example:

<p>The deadline is <ins>Friday</ins>.</p>

<mark> - Highlight

The <mark> element represents highlighted text. The default browser style is a yellow background, which this implementation matches.

Example:

<p>Search result: The <mark>quick brown fox</mark> jumps over.</p>

Changes

  • constants.py: Added 'ins': 'underline' to FONT_STYLES
  • h4d.py: Added handler for <mark> that applies yellow (#FFFF00) background using w:shd shading element (consistent with existing background-color mechanism)

Test plan

  • Verify <ins>text</ins> renders with underline
  • Verify <mark>text</mark> renders with yellow background
  • Verify nesting works (e.g., <mark><strong>bold highlight</strong></mark>)
  • Verify inline styles on <mark> can override the default yellow

arthrod and others added 2 commits January 8, 2026 22:17
Refactor HTML-to-DOCX with centralized styles and test coverage
Adds support for two HTML5 semantic elements:

1. <ins> tag - represents inserted text, rendered with underline
   - Added to FONT_STYLES mapping to 'underline' (same as <u>)

2. <mark> tag - represents highlighted text, rendered with yellow background
   - Uses w:shd shading element with yellow (#FFFF00) fill color
   - Consistent with the package's existing background-color mechanism

These tags are commonly used in markdown-to-HTML converters and
document editing applications.
@dfop02 dfop02 self-requested a review January 11, 2026 21:12
@dfop02 dfop02 added New Feature New feature or request good first issue Good for newcomers labels Jan 11, 2026
@dfop02 dfop02 changed the base branch from main to release/1.1.4 January 12, 2026 11:56
@dfop02 dfop02 self-assigned this Jan 14, 2026
@dfop02
Copy link
Owner

dfop02 commented Jan 25, 2026

hey @arthrod , Just a kindly reminder. Thanks!

@arthrod
Copy link
Author

arthrod commented Jan 25, 2026

Anything I can help?

@dfop02
Copy link
Owner

dfop02 commented Jan 26, 2026

Anything I can help?

@arthrod Yes, I reviewed your PR and there is pending changes, please take a look when had some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers New Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants