docblox/docblox — Issue #340: <code> tag not parsed correctly in descriptions
Author: Myatu
Created: 2012-01-08 13:10:20+00:00
State: open

Using DocBlox 0.18.0. This is similar to issue #153, but is in relation the use of a tag in the description. It does not appear to escape certain elements as they should be, causing the structure.xml to become malformed. Example:

```<p>This will process an AJAX call for this plugin. The 'ajaxResponse()' function
<em>MUST</em> be used to return any data, otherwise a 'No Event Response' error will be
returned to the AJAX caller.</p>

<p>It will verify the NONCE prior to triggering this event. If it fails this
verification, an error will be returned to the AJAX caller</p>

<p>Example:</p>

<pre><code>function getAjax(ajaxFunc, ajaxData) {
var resp = false;

$.ajax({
type : 'POST',
dataType : 'json',
url : my_plugin_name_ajax.url,
timeout : 5000,
async : false,
data : { action: my_plugin_name_ajax.action, func: ajaxFunc, data: ajaxData, _ajax_nonce: my_plugin_name_ajax.nonce },
success : function(ajaxResp) {
if (ajaxResp.nonce == my_plugin_name_ajax.nonceresponse & ajaxResp.stat == 'ok')
resp = ajaxResp.data;
}
});

return resp;
}
</code></pre>

<p>Wherein the plugin code, the onAjaxRequest() event is:</p>

<pre><code>function onAjaxRequest( $func, $data ) {
if ( $func == 'hello' ) {
$this->ajaxResponse('Hello World!');
} else {
$this->ajaxResponse('I don\'t know what to do!', true);
}
}
</code></pre>```

The error produced by DocBlox is:

```PHP Warning: DOMDocument::load(): xmlParseEntityRef: no name in /.../doc/html/structure.xml, line: 4212 in /.../docblox/src/DocBlox/Transformer.php on line 152
PHP Stack trace:
PHP 1. {main}() /.../docblox/bin/docblox.php:0
PHP 2. DocBlox_Task_Project_Run->execute() /.../docblox/bin/docblox.php:55
PHP 3. DocBlox_Task_Project_Transform->execute() /.../docblox/src/DocBlox/Task/Project/Run.php:188
PHP 4. DocBlox_Transformer->setSource() /.../docblox/src/DocBlox/Task/Project/Transform.php:218
PHP 5. DOMDocument->load() /.../docblox/src/DocBlox/Transformer.php:152
```

XML verification failure:

```XML Parsing Error: not well-formed
Location: file:///.../doc/html/structure.xml
Line Number 4212, Column 70: if (ajaxResp.nonce == my_plugin_name_ajax.nonceresponse & ajaxResp.stat == 'ok')
---------------------------------------------------------------------^```