Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24088

    spiros
    Participant

    I have some html where there are some unopened </i> tags on a per line basis and I want to delete them. I.e. in this line there are two of these.

    αντιστρόφως, </i>συνήθως βρίσκεται <i>ο</i> αντί <i>ο</i>, βλ. <i>ο</i>, έπειτα, παροδηγώ, παραπλανώ</i>, λέγεται για

    I got as far as matching well formed ones:
    <i>(.*?)</i>

    But then the only thing I could come with was do a find a replace on the remaining text (which would ignore the matched ones) to delete the remaining instances of closing tag (which is unopened), if somehow the matched text was excluded.

    I tried an html tidy extension on Notepad++ but it would break lines and add irrelevant code.
    Any ideas?

    #24090

    spiros
    Participant

    I also tried using Tidy as external tool https://www.emeditor.com/text-editor-features/extensibility/external-tools/ but it seems to have the same issue, I.e. adding extra line breaks.

    #24091

    Mr KT
    Participant

    Hello Spiros,
    hopefuly i’ve understood the question – does this give you what you require?:

    With “Use Regualr Expressions ticked” and under “Advanced” – “^ and $ can Match beginning and End of the selection”

    Find:^([^<i>]*)</i>
    Replace with:\1
    “Replace All” until no more instances found).
    then
    Find:(</i>[^</i>]*)</i>
    Replace with:\1
    (again, “Replace All” until no more instances found).

    #24092

    spiros
    Participant

    Yes, works great, thank you!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.