Forum closed. New forum available at http://community.wymeditor.org/

'join' regExps

Discuss features, code, contributions, ideas, suggestions, ...
For bugs, patches and feature requests, please post on the Trac:
http://trac.wymeditor.org/

'join' regExps

Postby onip on Tue Sep 02, 2008 2:38 pm

hi, i'm developing a plugin for an university project to make wymeditor support (some) microformats.
For this to work i need the xhtml validator to allow more expressions than strict xhtml (for example rel="nofollow" or rev="vote-for" in 'a' tags).
To do so during plugin initialization function i substitute
Code: Select all
WYMeditor.XhtmlValidator._tags['a']['attributes']['rev']
WYMeditor.XhtmlValidator._tags['a']['attributes']['rel']

with my own regexpr (ie. yours with some words added in the end).
Is there a smarter way to do this job? One that doesn't need me to manually adjust regexpr each time you change those?

EDIT: i'm working with svn version (currently r530)
User avatar
onip
 
Posts: 5
Joined: Tue Sep 02, 2008 1:11 pm

Re: 'join' regExps

Postby jfh on Wed Sep 10, 2008 9:18 pm

Hi, you can also extend the allowed attributes, by using jQuery.extend. See example 11, custom parser:
Code: Select all
jQuery.extend(WYMeditor.XhtmlValidator._tags['a']['attributes'], {'runat':/^(server)$/});

BTW, your project is very interesting. FYI, I'm also thinking about working on RDFa support.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Re: 'join' regExps

Postby onip on Thu Sep 11, 2008 7:11 am

$.extend adds new properties to target object or overwrites corresponding ones, am i wrong?
This is what i am already doing 'by hand'.
jfh wrote:BTW, your project is very interesting. FYI, I'm also thinking about working on RDFa support.

It should be near the end (not really complete, but enough for a school project), when finished I'll put it somewhere and ask for suggestions and comments.
User avatar
onip
 
Posts: 5
Joined: Tue Sep 02, 2008 1:11 pm

Re: 'join' regExps

Postby jfh on Sat Sep 13, 2008 7:43 pm

onip wrote:$.extend adds new properties to target object or overwrites corresponding ones, am i wrong?
This is what i am already doing 'by hand'.

OK.
onip wrote:It should be near the end (not really complete, but enough for a school project), when finished I'll put it somewhere and ask for suggestions and comments.

Great, thanks.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium


Return to Developers

Who is online

Users browsing this forum: No registered users and 2 guests