diff --git a/src/DocNet/Utils.cs b/src/DocNet/Utils.cs index aeb20e4..4808056 100644 --- a/src/DocNet/Utils.cs +++ b/src/DocNet/Utils.cs @@ -50,6 +50,7 @@ namespace Docnet DocNetMode = true, DocumentLocation = documentPath, DocumentRoot = siteRoot, + HtmlClassTitledImages = "Figure", }; var toReturn = parser.Transform(toConvert); diff --git a/src/MarkdownDeep/MardownDeep.cs b/src/MarkdownDeep/MardownDeep.cs index abea7c9..d74c70b 100644 --- a/src/MarkdownDeep/MardownDeep.cs +++ b/src/MarkdownDeep/MardownDeep.cs @@ -1002,7 +1002,6 @@ namespace MarkdownDeep // Use CSS to style the figure and the caption public string HtmlClassTitledImages { - // TODO: get; set; } diff --git a/src/MarkdownDeep/SpanFormatter.cs b/src/MarkdownDeep/SpanFormatter.cs index db534e4..dafc4fa 100644 --- a/src/MarkdownDeep/SpanFormatter.cs +++ b/src/MarkdownDeep/SpanFormatter.cs @@ -35,8 +35,10 @@ namespace MarkdownDeep // Parse the string into a list of tokens Tokenize(str, start, len); - // Titled image? - if (m_Tokens.Count == 1 && m_Markdown.HtmlClassTitledImages != null && m_Tokens[0].type == TokenType.img) + // If the image is a titled image and there's a class defined for titled images, we'll render it using special markup, otherwise we'll render + // the image as-is. + if (m_Tokens.Count == 1 && !string.IsNullOrWhiteSpace(m_Markdown.HtmlClassTitledImages) && m_Tokens[0].type == TokenType.img && + m_Tokens[0].data is LinkInfo && !string.IsNullOrWhiteSpace(((LinkInfo)m_Tokens[0].data).def.title)) { // Grab the link info LinkInfo li = (LinkInfo)m_Tokens[0].data;