sweble / sweble-wikitext

The Sweble Wikitext Components module provides a parser for MediaWiki's wikitext and an engine trying to emulate the behavior of a MediaWiki.
http://sweble.org/sites/swc-devel/develop-latest/tooling/sweble/sweble-wikitext
70 stars 27 forks source link

Permit <pre> tag via template expansion, allow <b> and <i> along with `''` and `'''` #46

Closed kno10 closed 7 years ago

kno10 commented 8 years ago

Resolves #43, and also replaces associated Internal Error messages with more helpful error messages #35 (but not all of them)

hannesd commented 8 years ago

Thanks for the pull request. Replacing the InternalErrors with other exceptions is a good thing. However, the solution for the pre problem has to look differently. The parser has to parse the wikitext as it is and must not alter (uppercase -> lowercase) text it finds in the source. Instead the expansion code in the engine has to make a case-insensitive search for a matching tag extension. I experimented on Wikipedia and parser functions are also case in-sensitive. I'll look into the engine code and make sure that both are treated correctly.

kno10 commented 8 years ago

These are now two less invasive changes, that simply tolerate <b>, <i> and <pre> in some cases where sweble would fail before. I don't have a nice unit test though.

kno10 commented 7 years ago

Outdated (except for the better exceptions).