Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsdoc-to-markdown generates invalid Markdown #268

Open
Anthony-Gaudino opened this issue Dec 9, 2021 · 1 comment
Open

jsdoc-to-markdown generates invalid Markdown #268

Anthony-Gaudino opened this issue Dec 9, 2021 · 1 comment

Comments

@Anthony-Gaudino
Copy link

We have some source files which contain comments not associated with any code, this is common in ExtJS code, please see https://docs.sencha.com/extjs/7.4.0/classic/src/ComboBox.js.html#Ext.form.field.ComboBox-event-select

The error we have is this:

ERROR in ./docs/js_docs_student/overwrites/Select2.md

Module build failed (from ./node_modules/@docusaurus/mdx-loader/lib/index.js):
SyntaxError: /home/anthony/safe_docs/safe/docs/docs/js_docs_student/overwrites/Select2.md: Expected corresponding JSX closing tag for <a>. (39:28)

  37 | you cannot use the Next button to get to this select field. This functionality works as expected on iOS.event_">"focus
  38 | Fires when this field receives input focus. This happens both when you tap on the field and when you focus on the field by using
> 39 | next or tab on a keyboard.`}</p>
     |                             ^
  40 | <p>{`Please note that this event is not very reliable on Android. For example, if your Select field is second in your form panel,
  41 | you cannot use the Next button to get to this select field. This functionality works as expected on iOS." (this, e)`}</a></dt></p>
  42 | <dd></dd>
    at Object._raise (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:541:17)
    at Object.raiseWithData (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:534:17)
    at Object.raise (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:495:17)
    at Object.jsxParseElementAt (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:7439:16)
    at Object.jsxParseElementAt (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:7407:32)
    at Object.jsxParseElementAt (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:7407:32)
    at Object.jsxParseElementAt (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:7407:32)
    at Object.jsxParseElement (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:7465:17)
    at Object.parseExprAtom (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:7472:19)
    at Object.parseExprSubscripts (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:11584:23)
    at Object.parseUpdate (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:11564:21)
    at Object.parseMaybeUnary (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:11539:23)
    at Object.parseMaybeUnaryOrPrivate (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:11353:61)
    at Object.parseExprOps (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:11360:23)
    at Object.parseMaybeConditional (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:11330:23)
    at Object.parseMaybeAssign (/home/anthony/safe_docs/safe/docs/node_modules/@babel/parser/lib/index.js:11290:21)

Here's a minimal file which causes the issue:

Ext.define('Ext.field.Select2', {
   /**
    * @event change
    * Fires when an option selection has changed
    * @param {Ext.field.Select} this
    * @param {Ext.data.Model} newValue The corresponding record for the new value
    * @param {Ext.data.Model} oldValue The corresponding record for the old value
    */

   /**
    * @event focus
    * Fires when this field receives input focus. This happens both when you tap on the field and when you focus on the field by using
    * 'next' or 'tab' on a keyboard.
    *
    * Please note that this event is not very reliable on Android. For example, if your Select field is second in your form panel,
    * you cannot use the Next button to get to this select field. This functionality works as expected on iOS.
    * @param {Ext.field.Select} this This field
    * @param {Ext.event.Event} e
    */
});

The result Markdown file is this:

## Events

<dl>
<dt><a href="#change
Fires when an option selection has changedevent_">"change
Fires when an option selection has changed" (this, newValue, oldValue)</a></dt>
<dd></dd>
<dt><a href="#focus
Fires when this field receives input focus. This happens both when you tap on the field and when you focus on the field by using
next or tab on a keyboard.

Please note that this event is not very reliable on Android. For example, if your Select field is second in your form panel,
you cannot use the Next button to get to this select field. This functionality works as expected on iOS.event_">"focus
Fires when this field receives input focus. This happens both when you tap on the field and when you focus on the field by using
next or tab on a keyboard.

Please note that this event is not very reliable on Android. For example, if your Select field is second in your form panel,
you cannot use the Next button to get to this select field. This functionality works as expected on iOS." (this, e)</a></dt>
<dd></dd>
</dl>

<a name="change
Fires when an option selection has changedevent_"></a>

## "change
Fires when an option selection has changed" (this, newValue, oldValue)
**Kind**: event emitted  

| Param | Type | Description |
| --- | --- | --- |
| this | <code>Ext.field.Select</code> |  |
| newValue | <code>Ext.data.Model</code> | The corresponding record for the new value |
| oldValue | <code>Ext.data.Model</code> | The corresponding record for the old value |

<a name="focus
Fires when this field receives input focus. This happens both when you tap on the field and when you focus on the field by using
next or tab on a keyboard.

Please note that this event is not very reliable on Android. For example, if your Select field is second in your form panel,
you cannot use the Next button to get to this select field. This functionality works as expected on iOS.event_"></a>

## "focus
Fires when this field receives input focus. This happens both when you tap on the field and when you focus on the field by using
next or tab on a keyboard.

Please note that this event is not very reliable on Android. For example, if your Select field is second in your form panel,
you cannot use the Next button to get to this select field. This functionality works as expected on iOS." (this, e)
**Kind**: event emitted  

| Param | Type | Description |
| --- | --- | --- |
| this | <code>Ext.field.Select</code> | This field |
| e | <code>Ext.event.Event</code> |  |

**documentation generated on Thu, 09 Dec 2021 13:01:03 GMT**

I'm using the example plugin which adds the date.

@fabienwnklr
Copy link

Hi, i have same issue, some fix or solutions? thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants