rednotebook icon indicating copy to clipboard operation
rednotebook copied to clipboard

Preview mode: Urls containing hashtags are broken and not styled properly

Open laraconda opened this issue 1 year ago • 1 comments

Describe the bug

When you add an url with '/#', the preview shows the string that follows the # as a tag. Moreover, the href in <a> tags contains <span> tags that should not be there.

Example of one of the links after being processed by t2t: <a href="http://www.mywebsite.org/<span style="color:red">#foo</span>/bar">http://www.mywebsite.org/<span style="color:red">#foo</span>/bar</a>

Visual:

Screenshot from 2023-06-01 16-29-59

When I disable the hashtag recognition in util/markup.py, the bug goes away, except that the full url is still not recognized as such correctly:

Screenshot from 2023-06-01 16-29-31

Trying to fix this problem by adding a '/' in the right regex in external/txt2tags.py makes the whole (from beginning to end) url to be marked as such, as it should be, but the hashtag is still recognized as a hashtag and the problem regarding spans in hrefs is still there.

Versions:

  • RedNotebook version :
  • Operating system and version: 2.29.6 (current master)
  • Os: debian 11

laraconda avatar Jun 01 '23 23:06 laraconda