-
-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove support for future script macros
libxml2 added support for future script macros based on the below specification https://www.w3.org/TR/html401/appendix/notes.html#h-B.7.1 This syntax was reserved, but has yet to be defined. It is still unclear how these macros will be used and what risks will be created if/when implemented. This PR removes support until more information is provided.
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From 27e4aa8d885e47a296ea78d114dbbe8fc7aa3508 Mon Sep 17 00:00:00 2001 | ||
From: Kevin Solorio <[email protected]> | ||
Date: Fri, 1 Feb 2019 14:32:42 -0800 | ||
Subject: [PATCH] Revert-support-html-h-b-7-1 | ||
|
||
--- | ||
entities.c | 17 ----------------- | ||
1 file changed, 17 deletions(-) | ||
|
||
diff --git a/entities.c b/entities.c | ||
index 43549bc5..82652f6d 100644 | ||
--- a/entities.c | ||
+++ b/entities.c | ||
@@ -623,23 +623,6 @@ xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input, int attr) { | ||
*out++ = 't'; | ||
*out++ = ';'; | ||
} else if (*cur == '&') { | ||
- /* | ||
- * Special handling of &{...} construct from HTML 4, see | ||
- * http://www.w3.org/TR/html401/appendix/notes.html#h-B.7.1 | ||
- */ | ||
- if (html && attr && (cur[1] == '{') && | ||
- (strchr((const char *) cur, '}'))) { | ||
- while (*cur != '}') { | ||
- *out++ = *cur++; | ||
- indx = out - buffer; | ||
- if (indx + 100 > buffer_size) { | ||
- growBufferReentrant(); | ||
- out = &buffer[indx]; | ||
- } | ||
- } | ||
- *out++ = *cur++; | ||
- continue; | ||
- } | ||
*out++ = '&'; | ||
*out++ = 'a'; | ||
*out++ = 'm'; | ||
-- | ||
2.16.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require "helper" | ||
|
||
module Nokogiri | ||
module HTML | ||
class TestAttributesDoNotSupportMacros < Nokogiri::TestCase | ||
def test_attribute_macros_are_escaped | ||
html = "<p><i for=\"&{<test>}\"></i></p>" | ||
document = Nokogiri::HTML::Document.new | ||
nodes = document.parse(html) | ||
|
||
assert_equal "<p><i for=\"&{<test>}\"></i></p>", nodes[0].to_s | ||
end | ||
end | ||
end | ||
end |