Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
laraconda opened this issue Jun 1, 2023 · 1 comment
Labels

Comments

@laraconda
Copy link
Contributor

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 laraconda added the bug label Jun 1, 2023
@laraconda
Copy link
Contributor Author

I think this problem is going to require some tinkering with t2t given how it is modifying href.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant