Signwriter filter replace the first element only.

zmove - May 13, 2009 - 10:19
Project:Signwriter
Version:6.x-2.x-dev
Component:User interface
Category:task
Priority:normal
Assigned:Justin W Freeman
Status:closed
Description

Hi,

First, thanks for this module that have a nice UI and works pretty fast and good.

However, I encounter problems with signwriter filter system, I think it's a bug as I'm on a fresh drupal install and I followed signwriter advices exactly as the examples.

So, I created a new profile, set up my fond, colors, etc... and this profils have to replace all

in my node body.

Here is the pattern I put in the "Input Filter Pattern : " : /

.*?<\/h3>/s
(So it's a copy/paste of the

example in the field description, juste replaced "1" by "3").

Now, my node body

<h2>My first title</h2>
<h3>My first signwriter title</h3>
<p>My first paragraph.<p>
<p>My second paragraph</p>
<h2>My second title</h2>
<h3>My second signwriter title</h3>
<p>My third paragraph</p>
...

The problem I have is that my first signwriter title is well replaced, but not the others one. Signwriter seems to stop after found the first instance...

Did I miss something, a bad configuration, or it's a true bug ?

Thanks for advices

zmove

#1

zmove - May 13, 2009 - 10:24

I forget to put some code tag which result to an unreadable post, here is the good one : (I putted some * to not parse html tag)

Hi,

First, thanks for this module that have a nice UI and works pretty fast and good.

However, I encounter problems with signwriter filter system, I think it's a bug as I'm on a fresh drupal install and I followed signwriter advices exactly as the examples.

So, I created a new profile, set up my fond, colors, etc... and this profils have to replace all

<*h3*> in my node body.<*/h3*>

Here is the pattern I put in the "Input Filter Pattern : " : /

/<h3.*>.*?<\/h3>/s
(So it's a copy/paste of the <*h1*> example in the field description, juste replaced "1" by "3").

Now, my node body

<h2>My first title</h2>
<h3>My first signwriter title</h3>
<p>Paragraph</p>
<h2>My second title</h2>
<h3>My second signwriter title</h3>
<p>Paragraph</p>
...

The problem I have is that my first signwriter title is well replaced, but not the others one. Signwriter seems to stop after found the first instance...

Did I miss something, a bad configuration, or it's a true bug ?

Thanks for advices

zmove

#2

zmove - June 5, 2009 - 07:43
Version:6.x-1.1» 6.x-2.x-dev

Hi,

I still don't have the solution, I tried to put the latest 2.x version. But same behavior.

I think it's possible to replace a pattern more than one time in a page, but I still don't know how...

#3

genox - June 14, 2009 - 01:14

Hi!

I have the same problem (drupal 6.12, latest stable release of signwriter). Copy/pasted the regex patterns from the examples. Every heading is only being rendered once - the following headings of the same type will be ignored.

Maybe someone can figure out a way to use something like "FlexiFilter"? Unfortunately, I kinda suck at creating regex patterns.. :-P

Otherwise, very nice module. Totally sweet to being finally able to use Univers Bold Condensed for headlines without ugly font downloading tweaks or the like. ;)

Thank you!

#4

selig - June 25, 2009 - 02:18
Status:active» needs review

Omitting the last "s" in the regexp should do the trick. Probably the example-text in the signwriter-file should be altered:
/<h3.*>.*?<\/h3>/

#5

zmove - June 25, 2009 - 07:00
Status:needs review» reviewed & tested by the community

I confirm that removing the "s" do the trick.

It's a very little thing but maybe the description of the field could be changed to explain that thing to regex noob like us.

#6

Justin W Freeman - June 25, 2009 - 07:33
Component:Code» User interface
Category:bug report» task

Agreed. Changing to UI component.

#7

Justin W Freeman - June 25, 2009 - 07:33
Assigned to:Anonymous» Justin W Freeman

#8

Justin W Freeman - July 2, 2009 - 12:51
Status:reviewed & tested by the community» fixed

Committed to 6.x-2.x-dev

#9

System Message - July 16, 2009 - 13:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.