~adnano/kiln-devel

Add section IDs to headers in html conversion v1 SUPERSEDED

alex wennerberg: 1
 Add section IDs to headers in html conversion

 1 files changed, 3 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~adnano/kiln-devel/patches/14306/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Add section IDs to headers in html conversion Export this patch

---
 html.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/html.go b/html.go
index 1620a84..bcb3e00 100644
--- a/html.go
+++ b/html.go
@@ -50,13 +50,13 @@ func gmiToHTML(text gmi.Text) []byte {
			fmt.Fprintf(&b, "%s\n", html.EscapeString(text))
		case gmi.LineHeading1:
			text := string(l.(gmi.LineHeading1))
			fmt.Fprintf(&b, "<h1>%s</h1>\n", html.EscapeString(text))
			fmt.Fprintf(&b, "<h1 id='%[1]s'>%[1]s</h1>\n", html.EscapeString(text))
		case gmi.LineHeading2:
			text := string(l.(gmi.LineHeading2))
			fmt.Fprintf(&b, "<h2>%s</h2>\n", html.EscapeString(text))
			fmt.Fprintf(&b, "<h2 id='%[1]s'>%[1]s</h1>\n", html.EscapeString(text))
		case gmi.LineHeading3:
			text := string(l.(gmi.LineHeading3))
			fmt.Fprintf(&b, "<h3>%s</h3>\n", html.EscapeString(text))
			fmt.Fprintf(&b, "<h3 id='%[1]s'>%[1]s</h1>\n", html.EscapeString(text))
		case gmi.LineListItem:
			text := string(l.(gmi.LineListItem))
			fmt.Fprintf(&b, "<li>%s</li>\n", html.EscapeString(text))
-- 
2.20.1
Ignore this patch, it has bugs.

On Wed Oct 14, 2020 at 11:43 AM PDT, alex wennerberg wrote: