Closed jxxcarlson closed 2 years ago
This is similar to the following extension: https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/undo-replacements-postprocessor.rb We should align the two since they are trying to accomplish the same goal.
Agreed!
One difference is that ent2uni replaces a class of things, whereas undo-replacements works from a pair of lists. One could switch between the two with an option.
A question. Is there a way of feeding the two lists to the UndoReplacementsPostprocessor? If so, the current setup could be the default, and so not need to be fed with args. Or one could feed it with arbitrary lists, or with a pair of symbols, e.g,
:html_entity, :unicode
in which case the effect would be that of ent2uni. This approach would be versatile, unified, and extensible — for instance one could add other symbol pairs for other tasks if needed.
On Nov 9, 2014, at 10:06 AM, Dan Allen notifications@github.com wrote:
This is similar to the following extension: https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/undo-replacements-postprocessor.rb https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/undo-replacements-postprocessor.rb We should align the two since they are trying to accomplish the same goal.
— Reply to this email directly or view it on GitHub https://github.com/asciidoctor/asciidoctor-extensions-lab/pull/22#issuecomment-62287661.
Is there a way of feeding the two lists to the UndoReplacementsPostprocessor?
We could certainly design it that way. This is all very much in the prototype and design phase, atm.
The post processor maps HTML entities to their unicode equivalents.
This was needed to sanitize output from the Asciidoctor LaTeX backend before running it through
xelatex
, but it is perhaps useful for other things as well.Current workflow for
.adoc
to.tex
using the normal math convention $ a^2 + b^2 = c^2 $ iswhere
and where
$pre
,$post
, and$lco
point totex-preprocessor.rb
,ent2uni.rb
, andasciidoctor-latex/converter.rb
.