Coder Social home page Coder Social logo

Comments (2)

djmtype avatar djmtype commented on June 20, 2024 1

BTW, in regards to choosing the plain text render, it would probably be ideal to remove images too.

BTW, it might be worth checking out how Astroplate handles the markdown body in order to return plain text. It uses the help of marked to parse the content, among other rules.

https://github.com/zeon-studio/astroplate/blob/main/src/lib/utils/textConverter.ts#L35

from npm-astro-post-excerpt.

igorskyflyer avatar igorskyflyer commented on June 20, 2024

@djmtype, thanks for taking your time to create the issue and providing a possible fix for it.
Indeed, everything except headings is left intact because the component's behavior is inspired by a very common Markdown authoring style, i.e.:


### Some heading

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam id elementum nunc. Morbi pharetra, sem interdum suscipit tristique, tellus mi sodales erat, id consectetur sem odio eget eros.

Aenean non laoreet quam, eget semper nisl. Suspendisse potenti. Aenean in convallis odio, id mollis neque. Vestibulum dictum, massa fringilla consectetur posuere, risus mi bibendum metus, id elementum massa libero in dolor. Phasellus mattis, nunc eu sollicitudin hendrerit, nisl eros bibendum enim, sed ultrices risus lacus vitae diam.

Nam sapien mauris, pretium nec eros et, mattis fermentum est.

### Some other heading

Etc.


Which in turn means anything else well stay as-is. Also *.mdx are quite more complex and difficult to strip of Markdown/JS code.

Either way, I can see the feature to strip all formatting as well being useful/needed and will be something I'll implement in the near future, quite possibly in the next release.

If you have any additional issues/comments feel free to post them. :)

from npm-astro-post-excerpt.

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.