You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i was wondering if there was a simple way to add image support (or any
other "tag" support without modifying the base code? i haven't looked at
the code, but i'm thinking something like:
Parser parser = new Parser();
TagSupport caret = new TagSupport() {
public String getTag() { return "^"; }
public String startTag(AttributeList attr) {
return "<caret>";
}
public String handleTag(String content) {
return content;
}
public String endTag() {
return "</caret>";
}
};
parser.addSupport(caret);
String test = "^test^";
String result = parser.toHtml(test); // returns "<caret>test</caret>"
if we had something like this, adding image support wouldn't be too hard.
i'm writing an application that needs to resize the images as static
files are created, this would make it easy to do so. it would also be
nice to be able to disable support for anything i wish. good job on the
parser by the way.
Original issue reported on code.google.com by [email protected] on 18 Mar 2008 at 7:47
The text was updated successfully, but these errors were encountered:
Wikipedia inserts images as links:
[[Image:image name.png]]
The double brackets are "SmartLinks" and, one can alter what happens when these
occur
by extending the HtmlVisitor class.
Currently, it appends the following:
start: <a href="[resolved link]">
end: </a>
You could overwrite this when an image link is detected:
start: <img src="[image link]" />
end:
(nothing for the end tag). Note that content still may appear after the image
if the
SmartLink had a caption. This is something I'm interested in changing too, as
customizing the parser is of course what we're most interested in.
Original issue reported on code.google.com by
[email protected]
on 18 Mar 2008 at 7:47The text was updated successfully, but these errors were encountered: