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

JavaScript type error when trying to mark as header (H2, H3, H4) #203

Open
ldibanyez opened this issue Jul 10, 2017 · 2 comments
Open

JavaScript type error when trying to mark as header (H2, H3, H4) #203

ldibanyez opened this issue Jul 10, 2017 · 2 comments

Comments

@ldibanyez
Copy link

Document stored in Databox (). When trying to mark as header (any of H2, H3, H4 buttons in the contextual menu) a highlighted excerpt of text, JavaScript type error is thrown. Tested on Firefox 54 and Chrome 59 on Ubuntu 16 64-bit. The errors are slightly differently phrased depending on the developer tool of the browser, but both refer to the same line in do.js:

Chrome:

Uncaught TypeError: Cannot read property 'length' of undefined
    at c.handleClick (do.js:5129)
handleClick @ do.js:5129

Firefox:

TypeError: parentSection.childNodes is undefined[Learn More] do.js:5129:37
	handleClick https://ldibanyez.databox.me/papers/scripts/do.js:5129:37
	bound handleClick self-hosted:913:17

All other buttons (italics, code, etc) work well. I tried the MediumEditor frontpage (http://yabwe.github.io/medium-editor/) and there I can change headers.

@csarven
Copy link
Member

csarven commented Jan 7, 2019

Ah.. so I suppose we should look into this 'soon' :)

To be clear, this issue occurs on new documents without any content.

Placing the following HTML inside the primary <article> is a temporary workaround ( from https://gitter.im/linkeddata/dokieli?at=5bff05ddcb32736b29ab2083 ) for this issue:

<h1 property="schema:name">Foo bar baz</h1>
<section id="introduction" rel="schema:hasPart" resource="#introduction">
  <h2 property="schema:name">Introduction</h2>
  <div datatype="rdf:HTML" property="schema:description">
    <p>Hello world!</p> 
  </div>
</section>

We need better handling of the headings in MediumEditor. Related issue is #271

@white-gecko
Copy link

Since this issue is not yet fixed I just add my remarks. Tell me, if this is a new issue.

When I try to make some selected text "h2" I get the following message in the js console of firefox:

TypeError: i.childNodes is undefined[Weitere Informationen]
bootstrap:12
handleClick
bootstrap:12
handleClick self-hosted:977:17 

I'm using firefox 60. This happens when I create a new document with https://dokie.li/new

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

No branches or pull requests

3 participants