ArrayHtml - Support comments
authorTim Otten <totten@civicrm.org>
Tue, 29 Oct 2019 22:31:06 +0000 (15:31 -0700)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:19 +0000 (19:13 -0700)
commitec9e7df3ba56ea80f0e5184e3354de946abc3c60
treeec2834eb1bbbbe967bfb235efd8f5741ec2ad14f
parent8f245854f571d7f49f440d13f871f8b8e8065042
ArrayHtml - Support comments

Before
------

HTML comments appear in the array as NULL values

After
-----

HTML comments appear in the array as `['#comment' => '...']`

Technical Notes
---------------

* Considered using `['#tag' => 'comment', '#children' => '...'], but this is ambiguous when you
  have a node/tag named '<comment>'
* Considered using `['#tag' => 'comment', '#children' => '...'], but it's needlessly difficult to
  extract the comment text from under `'#children'`.
ext/afform/core/CRM/Afform/ArrayHtml.php
ext/afform/mock/tests/phpunit/api/v4/AfformTest.php
ext/afform/mock/tests/phpunit/api/v4/formatExamples/comments.php [new file with mode: 0644]