[frontend] Add support for rendering MfmItalicNode
This commit is contained in:
parent
fbac96166e
commit
7b7dd2ee61
1 changed files with 8 additions and 1 deletions
|
@ -51,7 +51,7 @@ public class MfmRenderer
|
||||||
MfmNodeTypes.MfmFnNode mfmFnNode => throw new NotImplementedException(),
|
MfmNodeTypes.MfmFnNode mfmFnNode => throw new NotImplementedException(),
|
||||||
MfmNodeTypes.MfmHashtagNode mfmHashtagNode => throw new NotImplementedException(),
|
MfmNodeTypes.MfmHashtagNode mfmHashtagNode => throw new NotImplementedException(),
|
||||||
MfmNodeTypes.MfmInlineCodeNode mfmInlineCodeNode => throw new NotImplementedException(),
|
MfmNodeTypes.MfmInlineCodeNode mfmInlineCodeNode => throw new NotImplementedException(),
|
||||||
MfmNodeTypes.MfmItalicNode mfmItalicNode => throw new NotImplementedException(),
|
MfmNodeTypes.MfmItalicNode mfmItalicNode => MfmItalicNode(mfmItalicNode, document),
|
||||||
MfmNodeTypes.MfmLinkNode mfmLinkNode => throw new NotImplementedException(),
|
MfmNodeTypes.MfmLinkNode mfmLinkNode => throw new NotImplementedException(),
|
||||||
MfmNodeTypes.MfmMathInlineNode mfmMathInlineNode => throw new NotImplementedException(),
|
MfmNodeTypes.MfmMathInlineNode mfmMathInlineNode => throw new NotImplementedException(),
|
||||||
MfmNodeTypes.MfmMentionNode mfmMentionNode => MfmMentionNode(mfmMentionNode, document),
|
MfmNodeTypes.MfmMentionNode mfmMentionNode => MfmMentionNode(mfmMentionNode, document),
|
||||||
|
@ -82,6 +82,13 @@ public class MfmRenderer
|
||||||
return rendered;
|
return rendered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static INode MfmItalicNode(MfmNodeTypes.MfmItalicNode node, IDocument document)
|
||||||
|
{
|
||||||
|
var el = document.CreateElement("span");
|
||||||
|
el.SetAttribute("style", "font-style: italic");
|
||||||
|
return el;
|
||||||
|
}
|
||||||
|
|
||||||
private static INode MfmEmojiCodeNode(MfmNodeTypes.MfmEmojiCodeNode node, IDocument document)
|
private static INode MfmEmojiCodeNode(MfmNodeTypes.MfmEmojiCodeNode node, IDocument document)
|
||||||
{
|
{
|
||||||
var el = document.CreateElement("span");
|
var el = document.CreateElement("span");
|
||||||
|
|
Loading…
Add table
Reference in a new issue