Page MenuHomePhabricator

D17162.diff
No OneTemporary

D17162.diff

diff --git a/src/applications/phid/view/PHUIHandleListView.php b/src/applications/phid/view/PHUIHandleListView.php
--- a/src/applications/phid/view/PHUIHandleListView.php
+++ b/src/applications/phid/view/PHUIHandleListView.php
@@ -38,9 +38,13 @@
}
protected function getTagName() {
- // TODO: It would be nice to render this with a proper <ul />, at least in
- // block mode, but don't stir the waters up too much for now.
- return 'span';
+ if ($this->getAsText()) {
+ return null;
+ } else {
+ // TODO: It would be nice to render this with a proper <ul />, at least
+ // in block mode, but don't stir the waters up too much for now.
+ return 'span';
+ }
}
protected function getTagContent() {
diff --git a/src/view/AphrontTagView.php b/src/view/AphrontTagView.php
--- a/src/view/AphrontTagView.php
+++ b/src/view/AphrontTagView.php
@@ -92,6 +92,15 @@
final public function render() {
$this->willRender();
+ // A tag view may render no tag at all. For example, the HandleListView is
+ // a container which renders a tag in HTML mode, but can also render in
+ // text mode without producing a tag. When a tag view has no tag name, just
+ // return the tag content as though the view did not exist.
+ $tag_name = $this->getTagName();
+ if ($tag_name === null) {
+ return $this->getTagContent();
+ }
+
$attributes = $this->getTagAttributes();
$implode = array('class', 'sigil');
@@ -147,7 +156,7 @@
}
return javelin_tag(
- $this->getTagName(),
+ $tag_name,
$attributes,
$this->getTagContent());
}

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 31, 6:43 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6748634
Default Alt Text
D17162.diff (1 KB)

Event Timeline