~sircmpwn/sr.ht-discuss

3 3

markdown render dows not respect table cell alignment

Details
Message ID
<874jfwril1.fsf@city17.xyz>
DKIM signature
missing
Download raw message
Hello,

seems that the Markdown parser used in git.sr.ht does not handle text
alignment.

In the following example text will always render left-aligned:
https://paste.sr.ht/~jman/9df318b7dc8badf43348bd221f44d96e4f6c5aab

Am I missing something?

Can anyone please remind me which Markdown parser is using Sourcehut and
its project link? I might check out why it doesn't work as expected.

Thanks
Details
Message ID
<831a8bea-9a92-423b-9a30-f1baa4470a73@app.fastmail.com>
In-Reply-To
<874jfwril1.fsf@city17.xyz> (view parent)
DKIM signature
missing
Download raw message
On Mon, Jan 1, 2024, at 1:47 PM, jman wrote:
> Can anyone please remind me which Markdown parser is using Sourcehut and
> its project link? I might check out why it doesn't work as expected.

Sourcehut uses [mistletoe][1], as well as some [custom code][2] to 
render Markdown. I did some digging and wasn't able to determine why 
text alignment isn't supported.

[1]: https://github.com/miyuchina/mistletoe
[2]: https://git.sr.ht/~sircmpwn/core.sr.ht/tree/master/item/srht/markdown.py
Details
Message ID
<9b350e44-c2db-4749-8ff2-d75098cab711@bitfehler.net>
In-Reply-To
<831a8bea-9a92-423b-9a30-f1baa4470a73@app.fastmail.com> (view parent)
DKIM signature
missing
Download raw message
On 1/1/24 20:35, Noelle Leigh wrote:
> On Mon, Jan 1, 2024, at 1:47 PM, jman wrote:
>> Can anyone please remind me which Markdown parser is using Sourcehut and
>> its project link? I might check out why it doesn't work as expected.
> 
> Sourcehut uses [mistletoe][1], as well as some [custom code][2] to
> render Markdown. I did some digging and wasn't able to determine why
> text alignment isn't supported.

The SourceHut markdown renderer keeps a list of allowed 
elements/attributes to minimize the attack surface it provides. The 
align attributes used for cell alignment are currently not in that list. 
I suspect this is just an oversight, though. I submitted a patch [1] to 
fix that.

[1]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/48275

Cheers,
Conrad
Details
Message ID
<87o7e23uva.fsf@city17.xyz>
In-Reply-To
<9b350e44-c2db-4749-8ff2-d75098cab711@bitfehler.net> (view parent)
DKIM signature
missing
Download raw message
Thank you Conrad!
Reply to thread Export thread (mbox)