Class LogoTextPostProcessor
- All Implemented Interfaces:
org.commonmark.parser.PostProcessor
LaTeX, TeX) with NamedEntityNodes so they receive the
same styled HTML as the &LaTeX; / &TeX; entities.
Only Text nodes are affected. Nodes that are descendants of
Code or FencedCodeBlock are left untouched, so text inside
backtick spans and fenced code blocks is never altered.
Matching is case-sensitive and whole-token-aware: a match is only accepted
when it is not immediately preceded or followed by an ASCII letter
or digit, preventing partial matches inside words like "context" from
matching "tex".
When multiple logo names could match at the same position the longest one
wins (so LaTeX is preferred over TeX).
-
Constructor Summary
ConstructorsConstructorDescriptionLogoTextPostProcessor(Map<String, String> entityMap) Constructs a post-processor for the given entity map. -
Method Summary
Modifier and TypeMethodDescriptionorg.commonmark.node.Nodeprocess(org.commonmark.node.Node document)
-
Constructor Details
-
LogoTextPostProcessor
Constructs a post-processor for the given entity map.The entity names are extracted from the map's key set and sorted longest-first so that longer names (e.g.
LaTeX) are always tried before shorter ones that share a suffix (e.g.TeX). The HTML values are not needed here; resolution is handled at render time byNamedEntityNodeRenderer.- Parameters:
entityMap- the entity name → HTML map owned byNamedEntityExtension; only the keys are used
-
-
Method Details
-
process
public org.commonmark.node.Node process(org.commonmark.node.Node document) - Specified by:
processin interfaceorg.commonmark.parser.PostProcessor
-