summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZombienaute2017-09-13 21:34:51 +0200
committerEmil Stjerneman2017-09-13 21:34:51 +0200
commitd5beff3f77daa80366080369681dfff5a6b19825 (patch)
treef6d9809230798298f5ba40cf61adf1654d79c456
parente595d05a622f5ab75758dce5f11ae5208b991f91 (diff)
Issue #2887204 by acbramley, anon: Add data-entity-substitution automatically to filter_html rules
-rw-r--r--js/linkit.filter_html.admin.js4
-rw-r--r--tests/src/FunctionalJavascript/LinkitFormatAdminTest.php6
2 files changed, 5 insertions, 5 deletions
diff --git a/js/linkit.filter_html.admin.js b/js/linkit.filter_html.admin.js
index 6747908..3807f6e 100644
--- a/js/linkit.filter_html.admin.js
+++ b/js/linkit.filter_html.admin.js
@@ -41,8 +41,8 @@
rule.required.tags = ['a'];
rule.allowed.tags = ['a'];
// Attributes.
- rule.required.attributes = ['data-entity-type', 'data-entity-uuid', 'title'];
- rule.allowed.attributes = ['data-entity-type', 'data-entity-uuid', 'title'];
+ rule.required.attributes = ['data-entity-substitution', 'data-entity-type', 'data-entity-uuid', 'title'];
+ rule.allowed.attributes = ['data-entity-substitution', 'data-entity-type', 'data-entity-uuid', 'title'];
linkitFeature.addHTMLRule(rule);
return linkitFeature;
diff --git a/tests/src/FunctionalJavascript/LinkitFormatAdminTest.php b/tests/src/FunctionalJavascript/LinkitFormatAdminTest.php
index 56e7e77..7d2d79c 100644
--- a/tests/src/FunctionalJavascript/LinkitFormatAdminTest.php
+++ b/tests/src/FunctionalJavascript/LinkitFormatAdminTest.php
@@ -45,15 +45,15 @@ class LinkitFormatAdminTest extends JavascriptTestBase {
$page->findField('filters[filter_html][status]')->check();
$javascript = "(function (){ return jQuery('p.editor-update-message > strong').text(); })()";
- $this->assertNotContains('<a href hreflang data-entity-type data-entity-uuid title>', $session->evaluateScript($javascript));
+ $this->assertNotContains('<a href hreflang data-entity-substitution data-entity-type data-entity-uuid title>', $session->evaluateScript($javascript));
// Enable the 'Linkit filter' filter.
$page->findField('filters[linkit][status]')->check();
- $this->assertContains('<a href hreflang data-entity-type data-entity-uuid title>', $session->evaluateScript($javascript));
+ $this->assertContains('<a href hreflang data-entity-substitution data-entity-type data-entity-uuid title>', $session->evaluateScript($javascript));
// Disable the 'Linkit filter' filter.
$page->findField('filters[linkit][status]')->uncheck();
- $this->assertNotContains('<a href hreflang data-entity-type data-entity-uuid title>', $session->evaluateScript($javascript));
+ $this->assertNotContains('<a href hreflang data-entity-substitution data-entity-type data-entity-uuid title>', $session->evaluateScript($javascript));
}
}