ellmetha / django-precise-bbcode

A Django application for parsing, displaying and editing BBCodes-based text contents.
https://django-precise-bbcode.readthedocs.org
BSD 3-Clause "New" or "Revised" License
32 stars 10 forks source link

BBCode replacing URLs in contents #29

Open erisanolasheni opened 4 years ago

erisanolasheni commented 4 years ago

Hello I am current having this issues and it's quite annoying as BBCode parser is currently wrapping all url in <a> tags. I have disabled the Replace links options in all my custom BBCode tags so I don't know how this is happening.

Example use:

from precise_bbcode.bbcode import get_parser

body = '<html><head><title>Document</title></head><body><a href="https://html.spec.whatwg.org/">WHATWG HTML</a>.</body></html>';
parser = get_parser()
rendered = parser.render(body)

print(rendered)

Outputs

<a href="&lt;a href=" https:="" title="WHATWG HTML"><a href="https://html.spec.whatwg.org/">https://html.spec.whatwg.org/</a></a>

I think there should be a global setting that could be used to disable replace links for BBCodes tags, thank you.

theinvestigamer commented 2 years ago

Has this ever been addressed? I'm having the same issue

Goury commented 1 year ago

I feel like fixing this one next