Please sign in to comment.
NEW Make shortcode parser more clever about placement
Shortcodes have traditionally had a problem that they are inside <p> tags, but generate block level elements. This breaks HTML compliance. This makes the shortcode parser now mutate the DOM based on the "class" attribute on the shortcode to insert the generated block level element at the right place in the DOM - for "left" and "right" elements it puts them just before the block level element they are inside - for "leftAlone" and "center" elements it splits the DOM around the shortcode. The trade off is that shortcodes are no longer "text level" features. They need knowledge of the HTML they are in to perform this transformation, so they can only be used in (valid) HTML
- Loading branch information...
Showing with 7,289 additions and 58 deletions.
- +80 −14 docs/en/reference/shortcodes.md
- +382 −37 parsers/ShortcodeParser.php
- +61 −7 tests/parsers/ShortcodeParserTest.php
- +114 −0 thirdparty/html5lib/HTML5/Data.php
- +284 −0 thirdparty/html5lib/HTML5/InputStream.php
- +36 −0 thirdparty/html5lib/HTML5/Parser.php
- +2,422 −0 thirdparty/html5lib/HTML5/Tokenizer.php
- +3,840 −0 thirdparty/html5lib/HTML5/TreeBuilder.php
- +1 −0 thirdparty/html5lib/HTML5/named-character-references.ser
- +22 −0 thirdparty/html5lib/LICENSE
- +47 −0 thirdparty/html5lib/README
Oops, something went wrong.