~adnano/kiln-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[PATCH] Add section IDs to headers in html conversion

Details
Message ID
<20201014184425.28337-1-alex@alexwennerberg.com>
DKIM signature
fail
Download raw message
Patch: +3 -3 DKIM signature: fail
---
 html.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/html.go b/html.go
index 1620a84..538775c 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</h2>\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</h3>\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
Details
Message ID
<C6D6C33V9TEP.2G7HHM50ZSUY8@nitro>
In-Reply-To
<20201014184425.28337-1-alex@alexwennerberg.com> (view parent)
DKIM signature
missing
Download raw message
I'm not sure if section IDs are useful here, since Gemini does not allow
linking to sections.
Details
Message ID
<C6D6NSTC3XNR.20FOFY17NGMZF@debian-thinkpad>
In-Reply-To
<C6D6C33V9TEP.2G7HHM50ZSUY8@nitro> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
On Wed Oct 14, 2020 at 9:19 PM PDT, Adnan Maolood wrote:
> I'm not sure if section IDs are useful here, since Gemini does not allow
> linking to sections.

I view this less as useful within the gemini content itself but more as
just an HTML document, if that makes sense. I can link to
https://alex.flounder.online/#Other%20cool%20sites in an HTML
context. Might not be worth the added complexity.

Alex
Details
Message ID
<C6DN08SP2UVB.PW5812JSH3MB@nitro>
In-Reply-To
<C6D6NSTC3XNR.20FOFY17NGMZF@debian-thinkpad> (view parent)
DKIM signature
missing
Download raw message
I think there might be a problem with section IDs. Take this example:

	# Title
	=> #Title

In a Gemini client, the link would make a new request to the current URL
with the fragment #Title.
But with this patch, it would be converted to the following HTML:

	<h1 id="Title">Title</h1>
	<p><a href="#Title">#Title</a></p>

And then the link would wrongly point to the header.
Review patch Export thread (mbox)