details / summary do not fully expand

Ingmar's Avatar

Ingmar

28 Jul, 2020 09:00 AM

Details do not fully expand in the Marked beta.

Something like this:

<p>
<details>
<summary>Show solution</summary>

<pre><code>
package main

import (
    "fmt"
)

func main() {
    fmt.Println("Hello, playground")
}
</pre></code>

</details>
</p>

produces the attached screenshot, same with embedded Markdown code block with a language set.

'''language
code
'''

(replace ' with actual backticks)

It works if you resize the Marked window.

  1. Support Staff 1 Posted by Brett on 28 Jul, 2020 12:31 PM

    Brett's Avatar

    I assume if you turn off syntax highlighting in preferences it works as expected?

    - Brett

  2. 2 Posted by Ingmar on 28 Jul, 2020 12:41 PM

    Ingmar's Avatar

    Yes, that's correct!

  3. Support Staff 3 Posted by Brett on 28 Jul, 2020 01:01 PM

    Brett's Avatar

    So your code works properly for me using all of the built-in themes.
    When a details block is expanded, Marked runs a quick JS function that
    resizes the pre block to fit the code. It sounds like that's not
    happening for you. Could you right click on the document and choose
    Inspect Element, then switch to the console tab to see if there are any
    errors showing up?

    -Brett

  4. 4 Posted by Ingmar on 28 Jul, 2020 02:51 PM

    Ingmar's Avatar

    Yes, there is an error, see screenshot attached.

  5. Support Staff 5 Posted by Brett on 29 Jul, 2020 01:34 PM

    Brett's Avatar

    Unfortunately, that's a pretty generic error message that's going to be
    hard to debug without seeing it locally in my debugger. So I need to be
    able to replicate it. Could you please:

    1. Include the output of Help -> Report an Issue
    2. Let me know if you're running any kind of custom processor
    3. Attach a copy of a document that causes the issue for you (and if
    it's every document, just a generic sample section is fine)

    Thanks,
    Brett

  6. 6 Posted by Ingmar on 31 Jul, 2020 11:01 AM

    Ingmar's Avatar

    Sorry, that took a while.

    I'm running a pretty vanilla installation of the beta, so I don't use a custom processor.

    I've attached a generic example Markdown file.

    I also did some further testing:

    • It seems to happen with some specific styles. If I switch styles it sometimes works with the GitHub style and sometimes doesn't.
    • Other styles affected: Amblin, Grump
    • It only happens when syntax highlighting is enabled, the error always gets logged, independently of the style used.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • Bildschirmfoto_2020-07-28_um_10.55.24.png 167 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac