kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Better to use terminating semicolons after each style specifier
More compatible with TW2 tooprint-window-tiddler
rodzic
b13625daf0
commit
6745c7fbf7
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue