On Feb 17, 2:20 pm, wumpus <[email protected]> wrote:
> Hello
>
> I am trying to write a regular expression to match a embedded image
> within a tiddler.
The TW core wikify() parser already defines a regular expression for
each kind of 'formatter' that it recognizes, including one for the
"image" syntax:
config.formatters[config.formatters.findByField
("name","image")].lookaheadRegExp;
which has a default definition of:
/\[([<]?)(>?)[Ii][Mm][Gg]\[(?:([^\|\]]+)\|)?([^\[\]\|]+)\](?:\[([^\]]*)
\])?\]/mg
To view an example of some plugin code that modifies the image
formatter's regexp (and the associated handler), see:
http://www.TiddlyTools.com/#ImageSizePlugin
(The plugin adds support for an optional "[img(x,y)[...]]" syntax that
allows the rendered image to be automatically scaled to a specified
size)
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---