I created a paragraph with a text field that uses CKEditor text editor with Full HTML enabled. I switched to the Source
view and pasted the following code into CKEditor.
<!doctype html><html lang="en">
<head>
<meta charset="utf-8"><title>The HTML5 Herald</title>
<meta name="description" content="TheHTML5Herald">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
</head><body>
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
</body></html>
Very simple, I was just testing to see if it accepted script
and link
tags out of the box. After I saved the page and went back to edit it, the source view only showed:
<meta charset="utf-8">
<title></title>
<meta name="description" content="TheHTML5Herald"><meta name="author" content="SitePoint">
<link href="https: //stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" /><script src="https: //code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script><script src="https: //stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
Note that it removed the doctype
, html
and body
tags. What's weird is that in the database, the value for this field in this node is still exactly what I pasted in (with all the tags). Is there a hook or filter that is altering this before it is rendered? How can I prevent this to make sure it always displays what I previously pasted in?
I'm using Drupal 8 and the CKEditor version is 4.7.2 according to the JavaScript console.