Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Commit

Permalink
use abbr for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
OpportunityLiu committed May 30, 2020
1 parent 5ed5ea7 commit c6a7cf7
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions EhTagClient/MarkdigExt/Html/CodeInlineRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,35 @@ protected override void Write(HtmlRenderer renderer, CodeInline obj)
var content = obj.Content;
var tag = Extension.GetTagName(content);
if (renderer.EnableHtmlForInline)
renderer.Write("<ruby>");
if (tag != null)
{
renderer.WriteEscape(tag);
if (renderer.EnableHtmlForInline)
if (tag != null)
{
renderer.Write("<rp>(</rp><rt>");
renderer.Write("<abbr title=\"");
renderer.WriteEscape(content);
renderer.Write("</rt><rp>)</rp>");
renderer.Write("\">");
renderer.WriteEscape(tag);
}
else
{
renderer.Write('(');
renderer.Write("<abbr>");
renderer.WriteEscape(content);
renderer.Write(')');
}
renderer.Write("</abbr>");
}
else
{
renderer.WriteEscape(content);
if (tag != null)
{
renderer.WriteEscape(tag);
renderer.Write('(');
renderer.WriteEscape(content);
renderer.Write(')');
}
else
{
renderer.WriteEscape(content);
}
}
if (renderer.EnableHtmlForInline)
renderer.Write("</ruby>");
}
}
}

0 comments on commit c6a7cf7

Please sign in to comment.