Giter Club home page Giter Club logo

Comments (6)

tlyon3 avatar tlyon3 commented on May 28, 2024

@mmcky, the summary is rendering with Markdown support. The reason why it looks like that is because the user supplied that Markdown. We could either disable Markdown (probably not what we want to do) or parse the summary text and remove any Markdown that we don't want to render.

from bookshelf.

tlyon3 avatar tlyon3 commented on May 28, 2024

Just noticed that we may need to parse the summary text and remove unwanted Markdown. Otherwise we end up with these kinds of things...
image
The bullet points, I think, are fine. But the big h1 header is pretty ugly

from bookshelf.

GusHebblewhite avatar GusHebblewhite commented on May 28, 2024

@tlyon3 Haha yep that's what I was going for.

The same can be said of comments; using H1 looks really silly.

from bookshelf.

DrDrij avatar DrDrij commented on May 28, 2024

Can you strip all HTML markup from the listing page summaries?
The summary should be a string of characters from the summary without any formatting.

Ideally the markdown shouldn't allow h1,h2,h3 etc. But that's a different issue.

@mmcky I'd push for this to be a A3 release issue (pretty important visually the homepage can break)?

from bookshelf.

tlyon3 avatar tlyon3 commented on May 28, 2024

@DrDrij I believe this tool (https://www.npmjs.com/package/sanitize-html) can help. I think it works for Markdown as well. I lets you whitelist allowed tags (strong, a, i, etc...) and removes the rest

from bookshelf.

tlyon3 avatar tlyon3 commented on May 28, 2024

I've blacklisted headers so they won't render. Lists, bold, italics, etc will still render. If there are other tags people want to be blacklisted, let me know.

Closing this issue because the headers were the main problem.

from bookshelf.

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.