internal string ResolveHeaderID(Markdown m) { // Already resolved? if (this.data != null) { return((string)this.data); } // Approach 1 - PHP Markdown Extra style header id int end = contentEnd; string id = Utils.StripHtmlID(buf, contentStart, ref end); if (id != null) { contentEnd = end; } else { // Approach 2 - pandoc style header id id = m.MakeUniqueHeaderID(buf, contentStart, contentLen); } this.data = id; return(id); }
internal string ResolveHeaderID(Markdown m) { // Already resolved? var dataAsString = Data as string; if (dataAsString != null) { return(dataAsString); } // Approach 1 - PHP Markdown Extra style header id var end = ContentEnd; var id = Utils.StripHtmlID(Buf, ContentStart, ref end); if (id != null) { ContentEnd = end; } else { // Approach 2 - pandoc style header id id = m.MakeUniqueHeaderID(Buf, ContentStart, ContentLen); } Data = id; return(id); }