Comments (3)
For the inline code elements you would need to add a new parser method in InlineMethods.cs
- the current version contains a method InitializeParsers()
that will enable you to easily add the mapping and the parser itself is simple enough (since the elements cannot overlap other markdown elements like emphasis can).
For the block code elements you would need to add code to BlockMethods.cs
method incorporate_line()
. If you apply enough constraints on how the block has to look (for example, always start at the beginning of the line, always end on a separate line) it should not be too hard.
Both parsers will need to add elements into the AST, and you will need a new implementation of the renderer that will output the C# code.
Some other things to consider:
- Maybe for block elements you could use the markdown fenced code syntax? This way you don't need to extend the block parser at all.
- The same - maybe for inline code you could use markdown inline code syntax with backticks? With both of these you won't need to modify parsers at all.
Actually if you use the approach of using the default markdown code syntax, you will only need to create a new writer and that can be done without forking the project - just call ProcessStage1/2()
and feed the AST object to your own writer.
The drawback is that you loose Razor syntax highlighting. Maybe to mitigate it, you could mix both syntaxes:
```@{
CommonMarkSettings.UrlResolver = VirtualPathUtility.ToAbsolute;
var count = Model.Messages.Count();
}
```
Home
----
You have [`@count` unread messages](~/Messages).
from commonmark.net.
If you need any more information, feel free to reopen the issue.
from commonmark.net.
Thanks. I'll be working on this again in the future, but it's low priority ATM.
from commonmark.net.
Related Issues (20)
- Support for target attribute for links HOT 2
- Extend CommonMark.Net with custom rules HOT 1
- - [ ] Doesn't render a checkbox HOT 1
- Newlines appended to conversions HOT 2
- ASPNET Core 1.1 - You must add a reference to assembly 'mscorlib HOT 3
- CommonMark.CommonMarkConvert.Convert() adds two trailing CR/LFs HOT 1
- Nested parsed as List-List-List, always one list to much HOT 10
- How is syntax highlighting expected to work? HOT 3
- Nested list creating extra list when using tab indent not yet fixed HOT 1
- Image source containing spaces are not supported HOT 1
- Some KUDOS to you :) - && a feature request HOT 2
- Question Re AST - Not Issue HOT 1
- Cannot nest bold and italics
- Github style line breaks? HOT 1
- Pipe tables are not created when converting to HTML HOT 5
- Output of CommonMarkConverter.Convert("\\&") is "<p>&amp;</p>" HOT 1
- Benchmark with markdig HOT 1
- Bold, Italic, and monospace don't seem to be working for me. HOT 2
- 1111
- Sorry, noob question: Can I use this for Console.Program? HOT 2
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 commonmark.net.