• Resolved ZappoB

    (@zappob)


    Hi,

    I usually work in the visual editor (Classic, not Gutenberg), but I also make changes in the text editor. Here it happens from time to time that entries are deleted when switching back to the visual editor, e.g. an indicator I created for link formatting with CSS, which I called “no-ext-link-symbol” to format links specially.

    Edit: here a sample link:

    <a  target="_blank" rel="noopener noreferrer" no-ext-link-symbol>

    How can this manipulation by the visual editor be switched off?

    I found some information about linebreaks and paragraphs, but nothing about my specific problem.

    Thanks in advance for any helpful hints.

    VG, Zappo

    • This topic was modified 6 months, 2 weeks ago by ZappoB.
Viewing 4 replies - 1 through 4 (of 4 total)
  • An attribute such as no-ext-link-symbol on a link is not valid HTML. WordPress checks this and removes invalid information.

    What WordPress does here can certainly be customised. In your case, however, I would recommend that you write the code differently – so that it would also be valid according to HTML rules. Like this, for example:

    <a  target="_blank" rel="noopener noreferrer" class="no-ext-link-symbol">

    You can also define a rule for this using CSS, if that is what you are looking for.

    Thread Starter ZappoB

    (@zappob)

    Hi threadi,

    ok, got it, I changed it as you said and also changed the CSS accordingly, now WordPress has no problem with saving the HTML.

    Thank you very much for your help!

    Glad if I could help, you are welcome to set the topic to solved.

    Thread Starter ZappoB

    (@zappob)

    Now I did.

    Thanks again.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to stop visual editor changing my code?’ is closed to new replies.