Comments (3)
Instead of modifying the parser/renderer, the easiest way to do something like this is likely to post-process the syntax tree before you render it
MarkdownPipeline pipeline = new MarkdownPipelineBuilder()
.UseMathematics()
.Build();
string markdown = "$e=mc^2$";
MarkdownDocument document = Markdown.Parse(markdown, pipeline);
foreach (MathInline math in document.Descendants<MathInline>())
{
math.Content = new StringSlice(math.Content.ToString().Replace("e", "42"));
}
string html = document.ToHtml(pipeline);
// <p><span class="math">\(42=mc^2\)</span></p>
from markdig.
@MihaZupan it works good but escaping string that I put in content. So instead
<span class="katex">
I have:
<span class="katex">
Can I somehow write just this part unescaped?
from markdig.
Related Issues (20)
- Replacing LinkInline with reference form - how? HOT 6
- RoundTrip renderer not working?, breaking changes in output. HOT 3
- Rewriting HTML output - where to start? HOT 1
- Html generated links have nofollow? HOT 3
- Apply `foreach` on `class StringLineGroup` got phantom empty line, is it expected? HOT 2
- Question: Sanitize Markdown HOT 2
- Question: Guidance on implementing Plantuml renderer HOT 3
- Unable to get original content for LinkReferenceDefinitionGroup HOT 2
- Fails to substitute (**) with <strong> tags for Japanese and Chinese languages. HOT 3
- How can i print the original Inline code instead of the converted text? HOT 1
- How to make bold just a part of a word? HOT 1
- Emojis don't get converted at the start of links HOT 1
- Translate position from rendered HTML to markdown HOT 1
- Question: Having code blocks show in blocks HOT 4
- Roman Numeral V (5) is not computing correctly HOT 1
- Add support for GitHub Markdown Alerts HOT 3
- PipeTableParser strip opening and ending characters HOT 1
- Using context for extensions HOT 4
- AlertBlock content not rending properly HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdig.