Skip to content

Fix LaTeX formatting for AsciiDoc wiki

Jarka Kadlecova requested to merge 29852-latex-formatting into master

What does this MR do?

It fixes LaTeX formatting for AsciiDoc documents. It introduces AsciiPipeline (is uses same filters as MardownPipeline that was used before + AsciiPostProcessFilter). data-math-style is whitelisted in SanitiationFilter for pre and code elements. Classes necessary to format LaTeX code are added in AsciiPostProcessFilter for elements with data-math-style attribute present.

Are there points in the code the reviewer needs to double check?

In the original code we used

%(<code#{id_attribute(node)} class="code math js-render-math #{node.role}" data-math-style="inline">#{node.text}</code>)

I think that we don't use node.role for formatting but not 100% sure.

Why was this MR needed?

We removed class attribute from whitelist in SanitizationFilter because of security. But class is used to format LaTeX code.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #29852 (closed)

Edited by Jarka Kadlecova

Merge request reports

Loading