ReReplacer

Replacing mulitple HTML-lines

1 year 8 months ago #74922

Winfried's Avatar Winfried

Hi Peter,

I want to replace the following two lines with ReReplacer:
<div>
<span>Legenda:</span>

with
<div style="display: none;">
<span>Legenda:</span>

Should this be working if I would use the right strings?

Now it aint working.
Hope you can help me here.

1 year 8 months ago #74924

Peter van Westen's Avatar Peter van Westen Admin

Try with Regular Expressions:

<div>\s*<span>Legenda:</span>

1 year 8 months ago #74925

Winfried's Avatar Winfried

Hi Peter,

This didn't work.
Maybe I can clearify some more.
In Kunena Forum I don't want the Legenda to be visible for users.

The html code is in the image



I want to add style="display:none;" to the html-tag <div>

1 year 8 months ago #74926

Peter van Westen's Avatar Peter van Westen Admin

You should use the 'View Page Source' option in your browser to see the actual html output.
So don't use the 'Inspect Element' option.

1 year 8 months ago #74928

Winfried's Avatar Winfried

I used the next two lines:
Old: \s*<div>\s*\n\s*<span>Legenda:</span>
New: <div style="display: none;">\n\s<span>Legenda:</span>

Here are the lines within the pagesource:

1 year 8 months ago #74930

Peter van Westen's Avatar Peter van Westen Admin

Do you have this online so I can take a look?

1 year 8 months ago #74931

Peter van Westen's Avatar Peter van Westen Admin

PS: Make sure you switch on the Regular Expressions option in the ReReplacer item.

1 year 8 months ago #74932

Winfried's Avatar Winfried

My middle name is stupid 😉

Regular Expressions was still off.
It works fine now!

Thanks!

1 year 8 months ago #74933

Peter van Westen's Avatar Peter van Westen Admin

😉