flarum / issue-archive

0 stars 0 forks source link

[BBCode] Sometimes not closing an image tag errors out #243

Open dsevillamartin opened 5 years ago

dsevillamartin commented 5 years ago

I was editing a post, and accidentally left the closing img tag as open, resulting in [img width=300]https://i.imgur.com/BGJplYw.png[img]. This by itself does not cause an error, but something else in the post's content causes it to.

This occurred on Flarum Discuss, https://discuss.flarum.org/d/20525-friendsofflarum-follow-tags/1.

image image
Post Content (BBCode + Markdown) ~~~markdown # Follow Tags by [FriendsOfFlarum](https://discuss.flarum.org/d/16242-friends-of-flarum-the-collaboration-for-maintained-extensions) ![License](https://img.shields.io/badge/license-MIT-blue.svg) [![Latest Stable Version](https://img.shields.io/packagist/v/fof/follow-tags.svg)](https://packagist.org/packages/fof/follow-tags) [![Downloads](https://img.shields.io/packagist/dt/fof/follow-tags.svg)](https://packagist.org/packages/fof/follow-tags) [![OpenCollective](https://img.shields.io/badge/opencollective-fof-blue.svg)](https://opencollective.com/fof/donate) [![Patreon](https://img.shields.io/badge/patreon-datitisev-f96854.svg?logo=patreon)](https://patreon.com/datitisev) Follow tags and be notified of new discussions and replies. [img width=300]https://i.imgur.com/BGJplYw.png[img] ### Installation Use [Bazaar](https://discuss.flarum.org/d/5151-flagrow-bazaar-the-extension-marketplace) or install manually with composer: ```sh composer require fof/follow-tags ``` ### Updating ```sh composer update fof/follow-tags ``` ### Links [url=https://opencollective.com/fof/donate][img height=25]https://opencollective.com/fof/donate/button@2x.png?color=blue[/img][/url] [[img height=25]https://c5.patreon.com/external/logo/become_a_patron_button.png[/img]](https://patreon.com/datitisev) - [Packagist](https://packagist.org/packages/fof/follow-tags) - [GitHub](https://github.com/FriendsOfFlarum/follow-tags) An extension by [FriendsOfFlarum](https://github.com/FriendsOfFlarum). ~~~
Post Content (Compiled HTML) ~~~html

Follow Tags by FriendsOfFlarum

License Latest Stable Version Downloads OpenCollective Patreon

Follow tags and be notified of new discussions and replies.

[/url]

An extension by FriendsOfFlarum.

~~~
TypeError: m is null
    parseUrl forum-fca934d2.js:87
    forEach self-hosted:266
    parseUrl forum-fca934d2.js:87
    filter forum-fca934d2.js:85
    filterChain forum-fca934d2.js:69
    executeAttributeFilterChain forum-fca934d2.js:109
    filterAttributes forum-fca934d2.js:103
    oD76D04BF forum-fca934d2.js:69
    filterTag forum-fca934d2.js:107
    processStartTag forum-fca934d2.js:391
    processCurrentTag forum-fca934d2.js:389
    processTags forum-fca934d2.js:381
    parse forum-fca934d2.js:294
    preview forum-fca934d2.js:442
    o CommentPost.js:107

parseUrl is found @ https://github.com/s9e/TextFormatter/blob/5c18a0de1336a66001df6d0f69953d3d335b438a/src/Parser/AttributeFilters/UrlFilter.js#L41

franzliedke commented 5 years ago

I also see another pair of square quotes around the incorrect [url] tag? Maybe that was the problem? Would be cool if you could try to reduce this to the minimum failing example.