Skip to content

markdown: further HTML blocks improvement#200

Merged
ctapmex merged 1 commit into
colorer:masterfrom
exkrexpexfex:htmlmd
Jan 31, 2026
Merged

markdown: further HTML blocks improvement#200
ctapmex merged 1 commit into
colorer:masterfrom
exkrexpexfex:htmlmd

Conversation

@exkrexpexfex

Copy link
Copy Markdown
Contributor

Fixes nightroman/FarNet#71 new observations reported by @johnd0e

@nightroman

Copy link
Copy Markdown
Contributor

Some close-tags became open-tags. This does not change colors but look like a bug.
E.g. in

<div class="MyClass">
    <p>Inline HTML, not code</p>
</div>

</p> is now Region: html:htmlOpenTag (use F11 / FarColorer / Region info to see this).

@exkrexpexfex

Copy link
Copy Markdown
Contributor Author

htmlOpenTag and htmlCloseTag are the same in html.hrc and across all the base, so it makes no difference.

@johnd0e

johnd0e commented Jan 30, 2026

Copy link
Copy Markdown

htmlOpenTag and htmlCloseTag are the same in html.hrc and across all the base, so it makes no difference.

Sure they are related, and there can be no functional difference, but..
The are still semantically different entities, and it would be nice to be able to distinguish between them, e.g. for debugging purposes.

@johnd0e

johnd0e commented Jan 30, 2026

Copy link
Copy Markdown

What I've found.

README.md

<div align="center">

<img width="1232" height="693" alt="witr_banner" src="https://github.com/user-attachments/assets/e9c19ef0-1391-4a5f-a015-f4003d3697a9" />

</div>
image image
  • 1st screenshot: it's unclear why the space is colored (that does not happen in plain html). But not an issue of cause.
  • 2nd screenshot: the whole content of the tag is colored. That brings too much focus on the whole line. Though acceptable, I would prefer to avoid that. Is it fixable?

@johnd0e

johnd0e commented Jan 30, 2026

Copy link
Copy Markdown
image image

Under the new schema, tags are now italicized (they weren't before), but colored tags are not.
This inconsistency causes noticeable visual flicker when moving the cursor.
I would prefer the italicization of tags to remain constant, regardless of whether they are colored.

@exkrexpexfex

exkrexpexfex commented Jan 30, 2026

Copy link
Copy Markdown
Contributor Author

@johnd0e so we have to abandon pair match for HTML Blocks 6 and 7. Anyway we have abandoned it within the contents by the previous commit, so the inner tags are not paired anymore. Also the end of blocks 6 and 7 matching starting block is the empty line as per the specs, which cant be highlighted by colorer unless it contains whitespaces. So trying to highlight block start for these brings more confusion than benefit.
I've kept pair matching only for HTML Block type 1, as the contents is still parsed by original HTML scheme with open-closing tags matching.

Please check new version, I force pushed to keep the tree clean.

@johnd0e

johnd0e commented Jan 30, 2026

Copy link
Copy Markdown

LGTM
So tag name in italics is by design?

@exkrexpexfex

Copy link
Copy Markdown
Contributor Author

LGTM So tag name in italics is by design?

Depends on your HRD and font, I guess. By default seems not. From the repo root
./bin/colorer -c ./base/catalog.base.xml -h ./tests/test/other/markdown.md >test.html
gives
test.html

@nightroman

Copy link
Copy Markdown
Contributor

Looks good to me, @ctapmex please merge when you have some time. Thank you, everybody!

@ctapmex ctapmex merged commit 9497fb0 into colorer:master Jan 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Colorer markdown: legit inline html tags are marked as error due to xml validation

4 participants