dcwatson / bbcode

A pure python bbcode parser and formatter.
BSD 2-Clause "Simplified" License
68 stars 17 forks source link

I added a nofollow option to links, #28

Closed BrianMcKeever closed 6 years ago

BrianMcKeever commented 6 years ago

and I made it so the benchmark tool works on python2 and 3.

I made the nofollow option true by default since you don't normally want untrusted users to be able to damage your site's google ranking. Google explains it better than I do: https://support.google.com/webmasters/answer/96569?hl=en . I also updated the tests and the docs to explain the option.

dcwatson commented 6 years ago

Thanks for the PR! Take a look at #19 - I think adding a url_template argument is a more flexible approach. I'd even be OK with the default template including rel="nofollow".

BrianMcKeever commented 6 years ago

I adjusted it to use url_template.

dcwatson commented 6 years ago

I think this misses the intent of #19 - the url_template should be something like <a rel="nofollow" href="{href}">{text}</a>, not just an extra string to tack onto the <a> tag. Then the render function could just return self.url_template.format(href=href.replace('"', '%22'), text=value)

BrianMcKeever commented 6 years ago

I believe it is how you want it now.