Commit graph

10 commits

Author SHA1 Message Date
Frédéric Mangano-Tarumi
e15d5c8180 rendercomment: use python-markdown's new registration API
First, this gets rid of the deprecation warnings Python displayed.

Second, this fixes the case where a link contained a pair of
underscores, which used to be interpreted as an emphasis because the
linkify processor ran after the emphasis processor.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-02 20:49:16 +01:00
Frédéric Mangano-Tarumi
81faab9978 rendercomment: test headings lowering
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-02 20:49:16 +01:00
Frédéric Mangano-Tarumi
127bb4c84c rendercomment: safer Flyspray task linkification
When an FS#123 is part of a code block, it must not be converted into a
link. FS#123 may also appear inside an URL, in which case regular
linkifaction of URLs must take precedence.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-02 20:49:16 +01:00
Frédéric Mangano-Tarumi
199f34e42e rendercomment: safer auto-linkification of URLs
Fixes a few edge cases:

- URLs within code blocks used to get redundant <> added, breaking bash
  code snippets like `curl https://...` into `curl <https://...>`.

- Links written with markdown's <https://...> syntax also used to get an
  extra pair of brackets.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-02 12:12:43 +01:00
Frédéric Mangano-Tarumi
0fc69e96bd rendercomment: add a test for Git commit links
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-02 12:12:43 +01:00
Lukas Fleischer
362ee754e7 Do not keep line breaks in comments
With the new Markdown support, text paragraphs are now properly
converted to HTML paragraphs, so we no longer need to keep line breaks.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-24 21:10:02 +02:00
Lukas Fleischer
482bd10a8b t2600: Test Markdown and HTML sanitizing
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-24 17:41:35 +02:00
Lukas Fleischer
bb623fc545 Make references to Git commits clickable
Automatically detect Git commit identifiers, shorten them, and make them
link to the cgit interface.

Implements FS#43290.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-24 17:41:35 +02:00
Lukas Fleischer
9aa4203c7e Add Markdown support to package comments
Support Markdown syntax in package comments. Among other things, this
makes it easier to paste command line output and patches.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-23 18:43:26 +02:00
Lukas Fleischer
016b40f99d Render comments when storing them in the database
Instead of converting package comments from plain text to HTML code when
they are displayed, do the conversion when the comment is posted and
store the rendered result in the database. The conversion itself is done
by a Python script which uses Bleach for sanitizing the text.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-23 18:43:26 +02:00