Browse Source

Enabled Titled Image rendering. No CSS yet

Titled image rendering is enabled by default, and is used if the image
specification contains a title specification, like: ![alt text](image
url "title"). If the title is omitted, the image is rendered normally.
tags/v0.10
Frans Bouma 10 years ago
parent
commit
b1784a7c82
3 changed files with 5 additions and 3 deletions
  1. +1
    -0
      src/DocNet/Utils.cs
  2. +0
    -1
      src/MarkdownDeep/MardownDeep.cs
  3. +4
    -2
      src/MarkdownDeep/SpanFormatter.cs

+ 1
- 0
src/DocNet/Utils.cs View File

@@ -50,6 +50,7 @@ namespace Docnet
DocNetMode = true,
DocumentLocation = documentPath,
DocumentRoot = siteRoot,
HtmlClassTitledImages = "Figure",
};

var toReturn = parser.Transform(toConvert);


+ 0
- 1
src/MarkdownDeep/MardownDeep.cs View File

@@ -1002,7 +1002,6 @@ namespace MarkdownDeep
// Use CSS to style the figure and the caption
public string HtmlClassTitledImages
{
// TODO:
get;
set;
}


+ 4
- 2
src/MarkdownDeep/SpanFormatter.cs View File

@@ -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;


Loading…
Cancel
Save