1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-29 15:30:47 +00:00

Better to use terminating semicolons after each style specifier

More compatible with TW2 too
This commit is contained in:
Jeremy Ruston 2012-06-14 19:03:51 +01:00
parent b13625daf0
commit 6745c7fbf7
2 changed files with 7 additions and 7 deletions

View File

@ -28,12 +28,12 @@ exports.name = "style";
exports.blockParser = true;
exports.regExpString = "@@[a-zA-Z0-9_\\-]+:.*$";
exports.regExpString = "@@[a-zA-Z0-9_\\-]+:.*;$";
exports.parse = function(match,isBlock) {
var styles = {},
tree = [],
reStyleSpecififer = /@@([a-zA-Z0-9_\-]+):(.*)((?:\r?\n)?)/mg,
reStyleSpecififer = /@@([a-zA-Z0-9_\-]+):(.*);((?:\r?\n)?)/mg,
reEndString = "@@",
endMatch;
// Look for the first style specifier

View File

@ -3,16 +3,16 @@ title: StyleBlockWikiText
This syntax enables you to assign arbitrary styles to generated elements. For example:
{{{
@@color:#f00
@@text-decoration:underline
@@color:#f00;
@@text-decoration:underline;
This is in red!
@@
}}}
Generates the results:
@@color:#f00
@@text-decoration:underline
@@color:#f00;
@@text-decoration:underline;
This is in red!
@@
@ -25,7 +25,7 @@ The HTML looks like this:
Note that the style block doesn't generate any HTML elements itself, but instead causes the styles to be applied to all of the elements contained within the style block. This means that you can assign styles to elements generated from WikiText. For example, here is a list with some additional styles applied:
{{{
@@background-color:#00f
@@background-color:#00f;
* First item
* Second item
* Third item