Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F17676787
D20644.id49249.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D20644.id49249.diff
View Options
diff --git a/src/markup/engine/__tests__/remarkup/table-with-direct-content.txt b/src/markup/engine/__tests__/remarkup/table-with-direct-content.txt
new file mode 100644
--- /dev/null
+++ b/src/markup/engine/__tests__/remarkup/table-with-direct-content.txt
@@ -0,0 +1,5 @@
+<table>quack</table>
+~~~~~~~~~~
+<table>quack</table>
+~~~~~~~~~~
+<table>quack</table>
diff --git a/src/markup/engine/remarkup/blockrule/PhutilRemarkupTableBlockRule.php b/src/markup/engine/remarkup/blockrule/PhutilRemarkupTableBlockRule.php
--- a/src/markup/engine/remarkup/blockrule/PhutilRemarkupTableBlockRule.php
+++ b/src/markup/engine/remarkup/blockrule/PhutilRemarkupTableBlockRule.php
@@ -53,7 +53,11 @@
}
}
- return phutil_implode_html('', $out);
+ if ($this->getEngine()->isTextMode()) {
+ return implode('', $out);
+ } else {
+ return phutil_implode_html('', $out);
+ }
}
private function newTable(PhutilDOMNode $table) {
@@ -117,7 +121,7 @@
return $table->newRawString();
}
- $content = $cell->getRawContentString();
+ $content = $cell->newRawContentString();
$content = $this->applyRules($content);
$cell_specs[] = array(
diff --git a/src/parser/html/PhutilDOMNode.php b/src/parser/html/PhutilDOMNode.php
--- a/src/parser/html/PhutilDOMNode.php
+++ b/src/parser/html/PhutilDOMNode.php
@@ -65,12 +65,12 @@
return $this;
}
- public function getRawString() {
+ public function newRawString() {
$raw = array();
$raw[] = $this->rawHead;
foreach ($this->getChildren() as $child) {
- $raw[] = $child->getRawString();
+ $raw[] = $child->newRawString();
}
$raw[] = $this->rawTail;
@@ -124,7 +124,7 @@
// Otherwise, this is some other tag. Convert it into a content
// node.
- $raw_string = $child->getRawString();
+ $raw_string = $child->newRawString();
$nodes[] = id(new self())
->setContent($raw_string)
@@ -134,14 +134,14 @@
return $this->mergeContentNodes($nodes);
}
- public function getRawContentString() {
+ public function newRawContentString() {
$content_node = $this->selectChildrenWithTags(array());
if (!$content_node) {
return '';
}
- return head($content_node)->getRawString();
+ return head($content_node)->newRawString();
}
public function mergeContent() {
@@ -189,7 +189,7 @@
$parts = array();
foreach ($item as $content_node) {
- $parts[] = $content_node->getRawString();
+ $parts[] = $content_node->newRawString();
}
$parts = implode('', $parts);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jul 14, 10:17 AM (2 w, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8441934
Default Alt Text
D20644.id49249.diff (2 KB)
Attached To
Mode
D20644: Improve coverage of remarkup "<table>" rule and fix some bad method calls
Attached
Detach File
Event Timeline
Log In to Comment