Hi!
I have done a mistake when creating my stylesheet.
We have set a tag as H2 for something that as to be a P tag.
Now the H2 style has been assigned in over 2000 topics.
Is there a way I can swap the H2 style or change H2 style to be a P style?
Thanks !
Marie-Eve
Swap Style Tag From H2 to P
-
mechartrand
- Propeller Head
- Posts: 15
- Joined: Thu Jul 12, 2012 7:08 pm
Re: Swap Style Tag From H2 to P
You have something like this <h2 class="dummy"> in the source code of your topics and you want to change it to <p class="dummy">?
You will need to develop a regular expression for a projectwide Find & Replace ... what Flare version do you use?
Why regular expressions? Because the following algorithm changes the starts of the tags only, e.g.:
You change <h2 class="dummy">Heading here</h2> into <p class="dummy">Heading here</h2> by:
1. CTRL + f
2. Find what: <h2 class="dummy">
3. Replace with: <p class="dummy">
4. Find in: Whole project
5. Find in source code
6. Start
7. Replace in all files
BUT: You need to change the closing tag too!! Otherwise Flare won't let you save those topics.
You enter the strings with regular expressions in steps 2 and 3 and set Use to 'Regular Expressions'. Some RegEx experts here will be able to give you the strings you need.
You will need to develop a regular expression for a projectwide Find & Replace ... what Flare version do you use?
Why regular expressions? Because the following algorithm changes the starts of the tags only, e.g.:
You change <h2 class="dummy">Heading here</h2> into <p class="dummy">Heading here</h2> by:
1. CTRL + f
2. Find what: <h2 class="dummy">
3. Replace with: <p class="dummy">
4. Find in: Whole project
5. Find in source code
6. Start
7. Replace in all files
BUT: You need to change the closing tag too!! Otherwise Flare won't let you save those topics.
You enter the strings with regular expressions in steps 2 and 3 and set Use to 'Regular Expressions'. Some RegEx experts here will be able to give you the strings you need.
Inge____________________________
"I need input! - Have you got input?"
"I need input! - Have you got input?"
-
nickatwork
- Sr. Propeller Head
- Posts: 457
- Joined: Thu Sep 16, 2010 6:31 am
- Location: London
Re: Swap Style Tag From H2 to P
To find that </h2> tag the following should work.
Find: (?<=<p class="dummy">.+)</h2>
Replace: </p>
Just make sure you back your project up first incase it all goes wrong. Start the find/replace and check the first few topics to make sure its working as expected, then just do replace all.
Find: (?<=<p class="dummy">.+)</h2>
Replace: </p>
Just make sure you back your project up first incase it all goes wrong. Start the find/replace and check the first few topics to make sure its working as expected, then just do replace all.
Re: Swap Style Tag From H2 to P
Tools like FAR HTML make jobs like this much easier. You can run a global search and replace and update both the start and end tags in one step.
-
mechartrand
- Propeller Head
- Posts: 15
- Joined: Thu Jul 12, 2012 7:08 pm
Re: Swap Style Tag From H2 to P
I love you guys! It works!
Thank you everyone for your answers.
The regular expression worked like a charm.
You avoided me 898 manual operations
You saved our lives here
Thank you everyone for your answers.
The regular expression worked like a charm.
You avoided me 898 manual operations
You saved our lives here