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

Cannot read property 'highlight' of undefined - when using an indented code block #1348

Closed
wsw70 opened this issue Oct 2, 2018 · 2 comments

Comments

@wsw70
Copy link

wsw70 commented Oct 2, 2018

Initially submitted here, it seems that the bug is finally with Docute (egoist/docute#179)

I will leave the original submission here, in case someone has the same problem.


Describe the bug

I am testing Docute (https://docute.org/#/) and (following a failed rendering), the console mentioned

Uncaught (in promise) TypeError: Cannot read property 'highlight' of undefined
Please report this to https://github.com/markedjs/marked.
    at U.n.code (docute.js:1)
    at V.tok (docute.js:1)
    at V.parse (docute.js:1)
    at Function.V.parse (docute.js:1)
    at rt (docute.js:1)
    at docute.js:1

I am reporting it here and not with Docute, per the request in the error stack in the console.

To Reproduce
Steps to reproduce the behavior:

Expose the following two files via a web server (devd in my case), the HTML file is the first example given in Docute.

The error is on the block containing code

  • index.html
<!DOCTYPE>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>My Docs</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docute@4/dist/docute.css">
  </head>
  <body>
    <div id="docute"></div>
    <script src="https://cdn.jsdelivr.net/npm/docute@4/dist/docute.js"></script>
    <script>
      new Docute({
        target: '#docute'
      })
    </script>
  </body>
</html>
  • README.md (please take the source code, as the version below is rendered by GitHub and i do not know how to make it raw (non-rendered) data)

--- snip ---
text

code

text
--- snip ---

@wsw70 wsw70 changed the title Cannot read property 'highlight' of undefined Cannot read property 'highlight' of undefined - when using an indented code block Oct 2, 2018
@styfle
Copy link
Member

styfle commented Oct 2, 2018

Hi @wsw70,

This is a mystery. It sounds like the options somehow became null so maybe docute is overriding marked.defaults somehow?

You'll have to get this changed in the docute repo (it looks like you already made an issue docute#179)

@wsw70
Copy link
Author

wsw70 commented Oct 2, 2018

OK, thank you. I will swap the bug reports - having the one at Docute being the master and this one just pointing to it (if you want to - the error message suggests to post it here in the first place so maybe leaving a trace pointing back to Docute would be useful)

@wsw70 wsw70 closed this as completed Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants