django-precise-bbcode icon indicating copy to clipboard operation
django-precise-bbcode copied to clipboard

BBCode replacing URLs in contents

Open erisanolasheni opened this issue 5 years ago • 2 comments
trafficstars

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.

erisanolasheni avatar May 08 '20 12:05 erisanolasheni

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

theinvestigamer avatar Oct 07 '22 23:10 theinvestigamer

I feel like fixing this one next

Goury avatar Aug 08 '23 12:08 Goury