mirror of
https://github.com/danpros/htmly.git
synced 2026-04-22 05:26:22 +05:30
Fix editor tags HTML entities
This commit is contained in:
parent
cf7329dce8
commit
f6a8caa379
2 changed files with 18 additions and 2 deletions
|
|
@ -42,11 +42,19 @@ if (file_exists($field_file)) {
|
||||||
<link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css">
|
<link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css">
|
||||||
<script>
|
<script>
|
||||||
$( function() {
|
$( function() {
|
||||||
|
// Decode HTML entities
|
||||||
|
function decodeHtml(html) {
|
||||||
|
var txt = document.createElement("textarea");
|
||||||
|
txt.innerHTML = html;
|
||||||
|
return txt.value;
|
||||||
|
}
|
||||||
|
|
||||||
var availableTags = [
|
var availableTags = [
|
||||||
<?php foreach ($tags as $tag => $count):?>
|
<?php foreach ($tags as $tag => $count):?>
|
||||||
"<?php echo tag_i18n($tag) ?>",
|
"<?php echo tag_i18n($tag) ?>",
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
];
|
].map(decodeHtml); // Decoding all tags
|
||||||
|
|
||||||
function split( val ) {
|
function split( val ) {
|
||||||
return val.split( /,\s*/ );
|
return val.split( /,\s*/ );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,11 +88,19 @@ if (file_exists($field_file)) {
|
||||||
<link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css">
|
<link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css">
|
||||||
<script>
|
<script>
|
||||||
$( function() {
|
$( function() {
|
||||||
|
// Decode HTML entities
|
||||||
|
function decodeHtml(html) {
|
||||||
|
var txt = document.createElement("textarea");
|
||||||
|
txt.innerHTML = html;
|
||||||
|
return txt.value;
|
||||||
|
}
|
||||||
|
|
||||||
var availableTags = [
|
var availableTags = [
|
||||||
<?php foreach ($tags as $tag => $count):?>
|
<?php foreach ($tags as $tag => $count):?>
|
||||||
"<?php echo tag_i18n($tag) ?>",
|
"<?php echo tag_i18n($tag) ?>",
|
||||||
<?php endforeach;?>
|
<?php endforeach;?>
|
||||||
];
|
].map(decodeHtml); // Decoding all tags
|
||||||
|
|
||||||
function split( val ) {
|
function split( val ) {
|
||||||
return val.split( /,\s*/ );
|
return val.split( /,\s*/ );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue