0

I came across this issue. I wrote an article in editor and I put there basic HTML tags like <strong> and so on. The thing is, in editor it shows right, but when I publish the article, the HTML tags dont do anything and they are displayed just like normal text. Do you have any idea why is this happening? Thank you for any reply

2 Answers 2

1

i hope , you have used basic html filter. Basic filter doesn't support all of the tags of html. you have to use full html filter instead of basic html.

9
  • Yes, just found out about it now. Is there any way I can set Full HTML on multiple nodes at once? I have to set it on multiple nodes, so if it is possible to set it on multiple nodes at once so I dont have to edit every node one by one.
    – Adam Šulc
    Aug 9, 2018 at 9:53
  • use hook_node_add or hook_node_preserve to achieve this to multiples nodes. Aug 9, 2018 at 9:55
  • Alright, can you please tell me where should I put this? I am totally new to Drupal.
    – Adam Šulc
    Aug 9, 2018 at 9:56
  • just put this in your .module file Aug 9, 2018 at 9:59
1

You need to configure the HTML accepted by the filter in use to match your wysiwyg settings, otherwise you are likely to get mismatches like this, where the editor generates HTML that is filtered out before display, or shown as plain text.

Fortunately the field data stored in the database will include the HTML, so you may be able to fix this purely by adjusting the settings of the filter.

Be careful, though, you also need to consider what different classes of users are allowed to do, so if you have a filter that's available to all users you probably want to keep it restricted in terms of the HTML. Configure (and add) filters and editor settings to match user requirements.

3
  • The OP said the HTML tags are showing as plain text. If that is the case, HTML tags aren't filtered out.
    – apaderno
    Aug 9, 2018 at 11:45
  • Good catch, in that case the filter must be a plain text one which escapes HTML. Either way, the filter isn't set up right. Aug 9, 2018 at 12:44
  • 1
    Exactly. I added that in the answer, so the OP cannot think this is not the case described in the question.
    – apaderno
    Aug 9, 2018 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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