It is impossible to use an icon as anchor in wysiwyg blocks.

<a href="https://myfburl"><i class="fab fa-facebook-f "></i></a>

The content is lost when editing back a block

it only works for strings

 <a href="https://myfburl">some text</a>
  • You're not closing the <a> – Clive Nov 29 '19 at 16:23
  • u are right but this also <ul class="rs"> <li> <a aria-label="lien Facebook" title="Facebook" href="myfburl"> <i class="fab fa-facebook-f "> </i> </a> </li> </ul> – Matoeil Nov 29 '19 at 16:33
  • is this not valid? – Matoeil Nov 29 '19 at 16:34
  • to be more precise the module is wysiwyg and not ckeditor – Matoeil Nov 29 '19 at 16:45
  • 1
    Maybe you didn't allow <i> in your text format settings under allowed tags? – leymannx Nov 29 '19 at 19:01

If this only happens when a Text format is associated with a WYSIWYG profile, regardless of the format's Text filters or the Editor assigned to it, then try using a non-breaking space (&nbsp;) as the anchor text:

<a href="https://myfburl"><i class="fab fa-facebook-f "></i>&nbsp;</a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.