question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

browser.markdown fails at ordered list?

See original GitHub issue

Bonjour, Pierre. I notice that the browser.markdown does not (yet?) support ordered list.

from browser import markdown
payload = """
1. hello
2. world
"""
html, scripts = markdown.mark(payload)

It would encounter an exception.

 Traceback (most recent call last):
  File http://192.168.1.8:8000/main.py line 49, in <module>
    html, scripts = markdown.mark(payload)
  File VFS.browser.markdown.py line 154, in mark
    lines[i]='<li>'+lines[i][len(mo.groups()[0]):]
IndexError: tuple index out of range

By the way, can you also give a sample of markdown snippet here (and later also add it to this document page), to demonstrate what input would generate that scripts?


Off-topic: I also attempted to use brip to install this generic markdown module. The installation was successful, but the import markdown failed with this trace:

 Traceback (most recent call last):
  File http://192.168.1.8:8000/main.py line 50, in <module>
    import markdown
  File VFS.markdown/__init__.py line 29, in <module>
    from .core import Markdown,markdown,markdownFromFile
  File VFS.markdown.core.py line 26, in <module>
    from . import util
ImportError: cannot import name 'util'

Not sure whether Brython’s VFS is expected to support from . import module. Those are typical errors I encountered when I worked on brip. Perhaps you can also help take a look, too.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
PierreQuentelcommented, Aug 10, 2021

Ray,

The commit above should make the rendering of markdown pages much faster, the longest of your pages (Function.md) loads in about 3 seconds.

0reactions
rayluocommented, Aug 10, 2021

Amazing news! I tested it just now, and found out 2 things:

  1. Indeed it is much faster now!
  2. My computer is still 66% slower than yours. It took my computer 5 seconds. (Not a big deal. Haha.)

Thanks! Closing issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to escape ordered list · Issue #53 - GitHub
I'm trying to get the following string to render as a paragraph: "1. This is some text" This gets converted into an ordered...
Read more >
Markdown: continue numbered list - Stack Overflow
For those trying to continue a numbered list after something other than a code block. For example a second paragraph.
Read more >
Problems creating a bullet and number list with markdown
Let me specify: I'm trying to create a 2 item bullet list, some space, then a 3 item number list, some space, a...
Read more >
GitHub Pages: Ordered & Unordered Lists with Markdown
Your browser can't play this video. ... GitHub Pages: Ordered & Unordered Lists with Markdown. 508 views 3 years ago.
Read more >
Lists — Ordered, Unordered, Bullets and Nesting — Mastering ...
Working with lists and nested content in Markdown. ... Your browser can't play this video. ... 7.8K views 6 years ago Mastering Markdown....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found