i had thought that i needed to add some sort of word boundary character to get this to work; such as [].
and i only thought that since that was required to make this work.
but after looking at the code i see that the filter actually attempts to do what i need it to do; which is to use even spaces as a word boundary.
the issue is; that my wysiwyg editor doesnt allow me to put an acronym on a line by itself without stripping spaces.
so when i simply put:
CTA
even with spaces on either side of it, the output html that hits the abbrev filter looks like this:
<p> CTA</p>
so even though it replaces my first space with a nbsp, the semi-colon from that does work as a word boundary; but it simply strips the trailing space (and then adds P tags around the whole thing.
it would seem like this should still work; but the < in the closing P tag does not work as a word boundary and therefore a match is not found.
i am not a regex expert.. but i'll see if i can figure out the correct $pattern for this.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | abbrvfilter-use_tag_boundary.patch | 1.01 KB | liquidcms |
Comments
Comment #1
liquidcms commentedI am sure there is a reason for the < filter in the last line of $pattern definition; but if it is removed and the line becomes this:
this seems to work.
Comment #2
liquidcms commentedok, my fix above doesn't work. So still need a change to the regex so that html tags (actual just so that a <) is seen as a word boundary.
Comment #3
liquidcms commentedok, this seems better:
not sure why this line:
([^\>\w]) # Any character that is not a word character
simply a word boundary seemed better, so I replaced with
(/b)
and this works much better now.
also, i added support for i18n