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

%method-doc generates invalid HTML #47

Open
kazk opened this issue Oct 26, 2021 · 0 comments · May be fixed by #53
Open

%method-doc generates invalid HTML #47

kazk opened this issue Oct 26, 2021 · 0 comments · May be fixed by #53
Assignees
Labels
Milestone

Comments

@kazk
Copy link
Member

kazk commented Oct 26, 2021

This can be reproduced in 48abed4 so it's not caused by Marked update.

Input:

```%method-doc
{
  "method": "open_files",
  "desc": "Loops through any files that are not opened and opens them",
  "args": {
    "files": {
      "type": "Array<File>",
      "desc": "An array of file objects that may need to be opened"
    },
    "ext": {
      "type": "String",
      "desc": "An optional extension that may be used as a filter to determine which files to open"
    }
  }
}
```

Outputs something like this:

<div class="block block--docs method-doc">
<h3 id="h3_0">
  <code>
    <dfn class="doc-class">
      <dfn class="doc-name doc-name--method">open_files</dfn>
  </code>(<code><dfn class="doc-name doc-name--name">files</dfn></code>, <code><dfn class="doc-name doc-name--name">ext</dfn></code>)</h3><p>Loops through any files that are not opened and opens them</p></dfn>

</code> is unexpected there because <dfn class="doc-class"> that was opened in <code> is not closed. There's </dfn> all the way at the end.

This happens because marked-extensions handles @@doc tokens by global replacing strings carelessly :(

@kazk kazk added the bug label Oct 26, 2021
@kazk kazk added this to the v1 milestone Oct 26, 2021
@kazk kazk self-assigned this Nov 30, 2021
@kazk kazk linked a pull request Nov 30, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant