Commit Graph

14 Commits

Author SHA1 Message Date
Damian Mooyman
eb069e605d Remove all redundant whitespace 2014-08-19 09:17:15 +12:00
Andrew Short
a339687493 API: Pass extra context information to shortcode handlers.
This allows shortcodes to perform more complex actions on the element
which contains them. For example, the element reference can be used
to add extra classes or attributes to links which provide additional
metadata.
2013-10-09 15:05:17 +11:00
Simon Welsh
151baeede1 Correct line length and indentation 2013-08-21 18:54:05 +12:00
Ingo Schommer
0e5b099287 FIX Unquoted shortcodes weren't parsed (fixes #680)
Since that used to be the default shortcode notation
for our core "insert media" functionality, its important
to have this fixed and keep supporting "legacy" content
created with 3.0.
2013-04-26 01:00:13 +02:00
Hamish Friedlander
7afcd64418 FIX Make ShortcodeParser obey error_behavior in attribute scope 2013-02-22 11:34:15 +13:00
Hamish Friedlander
1ee01c39d4 FIX ShortcodeParser producing bad output after escaped tag
Also tightens up matching of shortcodes so we dont match on invalid shortcodes
2013-02-22 10:30:51 +13:00
Hamish Friedlander
2335c074b3 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
2013-02-18 10:49:52 +13:00
Sam Minnee
1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00
Simon Welsh
a172a2e731 BUGFIX: Handle consecutive shortcodes. 2012-05-23 18:18:06 +12:00
Simon Welsh
f07258f3cf MINOR Update @package values to match renaming sapphire 2012-04-15 10:50:19 +12:00
Sean Harvey
0df958f81d MINOR Fixed tests to use commas as delimiter for shortcodes, also test spaces still work as well 2012-03-09 15:00:03 +13:00
Sean Harvey
49267dbbc4 ENHANCEMENT Shortcodes now support commas as delimiter for attributes (thanks aoneil for help with the regex!) (trac #6868)
BUGFIX HtmlEditorField not inserting shortcodes correctly (trac #6868)
2012-03-09 14:25:42 +13:00
Ingo Schommer
ce8e72cf0e MINOR Removing executable flag from all files (thanks miiihi) 2011-09-18 22:04:02 +02:00
Ingo Schommer
9b29616710 API CHANGE Rearranged files in sapphire to reflect core dependencies more accurately, and have the tests/ folder mirror its folder structure 2011-03-31 09:56:21 +13:00