Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

endtag BBCODE_REQUIRED ignored #2

Open
Weilhart opened this issue Feb 18, 2015 · 1 comment
Open

endtag BBCODE_REQUIRED ignored #2

Weilhart opened this issue Feb 18, 2015 · 1 comment

Comments

@Weilhart
Copy link

All endtags seem to be obeying BBCODE_OPTIONAL no matter what. You can see the problem by parsing:

[img]some_image_url

without the [/img] endtag, which should be required. The image tag will be generated regardless. Seems to affect all tags.

@theyak
Copy link
Owner

theyak commented Feb 19, 2015

This is confirmed, however, this comment appears in the code:

            // This is a start tag that is either ending-optional or ending-forgotten.
            // But because of class dependencies, we can't simply reject it; deeper
            // tags may already have been processed on the assumption that this class
            // was valid.  So rather than reject it, as one might expect from
            // 'end_tag' => BBCODE_REQUIRED, we process it so that any deeper tags
            // that require it will still be treated correctly.  This is the only
            // alternative to having to perform two passes over the input, one to validate
            // classes and the other to convert the output:  So we choose speed over
            // precision here, but it's a decision that only affects broken tags anyway.

This just makes me wonder what the point of BBCODE_REQUIRED is, since it doesn't seem to do anything.

Unfortunately, the author of this library seems to have abandoned the project in 2010.

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

No branches or pull requests

2 participants