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
Rho supports image and links preprocessors out-of-the-box, just use ![Alt text][@post/img.png] or [Link text][@post] and then add these properties to the options:
new BlockCompiler({
resolveLink: function(data) {
// you can return either { url: '...', title: '...' } or just a string url
},
resolveImage: function(data) {
// you can return either { url: '...', title: '...' } or just a string url
}
}).toHtml(text);
As you can see, the code requires you to be synchronous (so, you can't fetch your post and read its title, for example). This is done to provide people with best performance possible.
As for the custom elements, yeah, it is supported, but requires you to learn a bit of internals (parser, parsing sequence, etc.) Unfortunately, the parser-emitter conventions are undocumented, but there's nothing too scary about them, if you read the code for BlockCompiler and InlineCompiler.
I can also recommend digging into another repository which takes advantage of custom elements for composing plain-text quizzes.
Is it possible to change the way existing markup elements work?
For example I have a image tag like
I attach a preprocessor to img markup, something like
to preprocess image urls.
Or is there a way to add new markup elements, such as
?
The text was updated successfully, but these errors were encountered: