Originally Posted by
listo95
So how would change color of text? Also move an image to say the right side of it?
All handled under the style section.
Think of every line as an HTML tag, nested under the parent line. Each of those lines can have styles.
Sample Rolecard
Code:
###
[RIGHT:http://www.pvv.org/~andreasd/mafia/rolecard_builder2/dagger.png,32,32] This is text and an image floats to the right of it. Feel free to add Lorem Ipsum test until you are satisfied about the wonders of right-facing images.
Sample Style:
Code:
[
{
"action": "block",
"regex": "^###(.*)",
"replace": "$1",
"style": "width: 670px; border: 1px solid black; background-color: #D3D3FC;
padding: 15px; box-shadow: 2px 2px #bab1bf; background-image: url(http://www.pvv.org/~andreasd/mafia/rolecard_builder2/bokeh.png)",
"onmouseover": "this.style.backgroundColor='#E3E3FE';",
"onmouseout": "this.style.backgroundColor='#D3D3FC';"
},
{
"action": "transform",
"search": "\[RIGHT:(\S*\.png|\S*\.jpg),(\S*),(\S*)\]",
"replace": "<u style='display:inline-block; float: right; background-image: url($1); width:$2px; height:$3px'></u>" // this works!
}
]
- - - Updated - - -
Also noticed that if you try to bold multiple words on the same line it will do everything between the first and last *.
Doh!
I thought I did a non-greedy regex. It is easy to fix...
Code:
// *Bold Text*
// Text immediately inbetween stars turn bold.
{
"action": "transform",
"search": "\*(\S[^*]*\S)\*",
"replace": "<b>$1</b>"
}
I've updated the default style to have this fix. Your localstorage copy won't have that fix unless you create a new style after refreshing....