Page MenuHomePhabricator

D20631.id.diff
No OneTemporary

D20631.id.diff

diff --git a/src/parser/html/PhutilHTMLParser.php b/src/parser/html/PhutilHTMLParser.php
--- a/src/parser/html/PhutilHTMLParser.php
+++ b/src/parser/html/PhutilHTMLParser.php
@@ -30,9 +30,13 @@
continue;
}
- if (!$in_tag && ($c === '<')) {
+ // When we encounter a "<", we start a new tag whether we're already in
+ // a tag or not. We want to parse "<x>1 < 2</x>" as a single tag with
+ // the content "1 < 2".
+
+ if ($c === '<') {
$segments[] = array(
- 'tag' => $in_tag,
+ 'tag' => false,
'pos' => $segment_pos,
'end' => $ii,
);
diff --git a/src/parser/html/__tests__/data/tag-angle.txt b/src/parser/html/__tests__/data/tag-angle.txt
new file mode 100644
--- /dev/null
+++ b/src/parser/html/__tests__/data/tag-angle.txt
@@ -0,0 +1,13 @@
+<math>1 < 2</math>
+~~~~~~~~~~
+[
+ {
+ "tag": "math",
+ "attributes": {},
+ "children": [
+ {
+ "content": "1 < 2"
+ }
+ ]
+ }
+]

File Metadata

Mime Type
text/plain
Expires
Tue, Feb 11, 5:04 AM (1 h, 33 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7122304
Default Alt Text
D20631.id.diff (1006 B)

Event Timeline