Giter VIP home page Giter VIP logo

Comments (3)

zerolab avatar zerolab commented on July 17, 2024 1

@tian-yan you should move that sort of logic to Python and probably use something like BeautifulSoup to do the processing that you need. Or write a custom template tag that takes your raw markdown, renders it and then pulls out whatever it needs. See waht the |markdown filter does - https://github.com/torchbox/wagtail-markdown/blob/main/wagtailmarkdown/templatetags/wagtailmarkdown.py#L20

Will close this issue as it is not a package-related issue per se.

I suggest asking support questions in the Wagtail Slack, the #support channel. See https://github.com/wagtail/wagtail/wiki/Slack for more details

from wagtail-markdown.

zerolab avatar zerolab commented on July 17, 2024

You are missing wagtailmarkdown in your {% load ... %} statement.

and you cannot use markdown.getElementsByTagName("P")[0]}} in a Django template tag as that is a JavaScript construct

from wagtail-markdown.

tian-yan avatar tian-yan commented on July 17, 2024

thanks for pointing out. I already updated wagtailmarkdown into the {% load ... %} in this post, it was added in as well in my source code.
Do we have any solution if I can not use getElementsByTagName please ?

from wagtail-markdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.