Skip to main content
tomoakin33355574
Participating Frequently
Jul 26, 2021 1:50 PM UTC
Answered

How can I delete multiple tags of both opening and closing tags but keep the text between tags?

I want to delete multiple tags of both opening and closing tags.

For example, in the next tags,

 

<span class="b">text</span>

 

I want to delete both <span class="b"> and </span>

but text should not be deleted.

 

There are a lot of codes like 

 

<span class="b">text</span>

<span class="b">happy</span>

<span class="b">time</span>

 

How can I delete not only <span class="b">, but also </span> but keep the 

text

happy

time

? (in the example above)

 

Thank you for your help.

 

 

 

    This topic is closed to new replies. Start a new post to keep the conversation going.
    B i r n o u
    B i r n o uCorrect answer
    Legend
    Jul 26, 2021 2:33 PM UTC

    @tomoakin33355574  try using search in files (Ctrl Shift F) then in advanced mode

     

    search for SPAN node

    havin an attribut class equal to B

     

    then in action of replacement choose

    cleaning node

     

    it will remove the node, but not the node text

    (be sure to make a back up of your site, before dealing with large search and replace in files

    10 replies

    B i r n o u
    B i r n o uCorrect answer
    Legend
    Jul 26, 2021 2:33 PM UTC

    @tomoakin33355574  try using search in files (Ctrl Shift F) then in advanced mode

     

    search for SPAN node

    havin an attribut class equal to B

     

    then in action of replacement choose

    cleaning node

     

    it will remove the node, but not the node text

    (be sure to make a back up of your site, before dealing with large search and replace in files

    Translate
    Participant
    May 3, 2024 9:36 PM UTC

    This is the absolute best solution and should be identified as such

    Translate
    tomoakin33355574
    Participating Frequently
    Jul 26, 2021 1:52 PM UTC

    I mean at the same time. like using find and replace all. not manually. I use dreamweaver. I really appreciate your help. 

    Translate
    Legend
    Jul 26, 2021 1:57 PM UTC

    Well just perform 'Find and Replace' 3 times 1 for each situation, DW will take care of all the instances it finds.

     

    Find:

    <span class="b">happy</span>

    Replace with:

    happy

     

    Find:

    <span class="b">time</span>

    Replace with:

    time

     

     

    There may be an expression you can use to just find all instances of:

     

    <span class="b"></span>

     

    and replace it with nothing, lets see if anyone can help out with an expression.

    Translate
    tomoakin33355574
    Participating Frequently
    Jul 26, 2021 2:05 PM UTC

     

    There may be an expression you can use to just find all instances of:

     

    <span class="b"></span>

     

    and replace it with nothing, lets see if anyone can help out with an expression.

     

    yes, exactly!  this is what I wanted to find out. I thought the same thing with you and thought it should not be difficult. But so far, adobe support even does not know it, so this can be very challenging topic. 

     

    I just wanted to get rid of all the unnecessary tags which is accidentally added.

     

    If we know this method, I think it helps a lot of blogers time, including me.

    Translate
    Legend
    Jul 26, 2021 1:52 PM UTC

    You could use the Find and Replace option in Dreamweaver:

     

    Find:

    <span class="b">text</span>

     

    Replace with:

    text

    Translate
    tomoakin33355574
    Participating Frequently
    Jul 26, 2021 1:54 PM UTC

    Thank you. 

     

    But I want to delete all the 

     

    <span class="b"></span>

     

    at the same time because 100 of the texts which uses 

     

    <span class="b"></span>

     

     

     

     

     

    Translate