From bb43074533d34685dbf920dc4b324169ea2ea961 Mon Sep 17 00:00:00 2001 From: gambas Date: Tue, 26 Jan 2021 06:13:44 +0100 Subject: [PATCH] Markdown.LinkAnchors is a new property that insert anchors for each line of the markdown text. [GB.MARKDOWN] * NEW: Markdown.LinkAnchors is a new property that insert anchors for each line of the markdown text. --- comp/src/gb.markdown/.src/Markdown.class | 1 + comp/src/gb.markdown/.src/Markup.module | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/comp/src/gb.markdown/.src/Markdown.class b/comp/src/gb.markdown/.src/Markdown.class index 99b2a26a4..ede1f83ad 100644 --- a/comp/src/gb.markdown/.src/Markdown.class +++ b/comp/src/gb.markdown/.src/Markdown.class @@ -7,6 +7,7 @@ Create Public Line As Integer Public Current As String Public Reinterpret As Boolean = True +Public LinkAnchors As Boolean Property Verbatim As Integer diff --git a/comp/src/gb.markdown/.src/Markup.module b/comp/src/gb.markdown/.src/Markup.module index 92ba7db1d..9fbee486d 100644 --- a/comp/src/gb.markdown/.src/Markup.module +++ b/comp/src/gb.markdown/.src/Markup.module @@ -126,6 +126,8 @@ Private Sub ConvertMarkup(aLine As String[], Optional bDoNotSetLine As Boolean) Inc iLine sLine = aLine[iLine] + If $hMarkdown.LinkAnchors Then aResult.Add("") + If Not bDoNotSetLine Then $hMarkdown.Line = iLine $hMarkdown.Current = sLine @@ -551,6 +553,8 @@ Private Sub ConvertMarkup(aLine As String[], Optional bDoNotSetLine As Boolean) aResult[iIndexPos] = "
\n" & ConvertMarkup($aIndex) & "
\n" Endif + If $hMarkdown.LinkAnchors Then aResult.Add("") + $bComment = bSaveComment $aMarkup = aSaveMarkup $aTable = aSaveTable