Coder Social home page Coder Social logo

Comments (2)

benwr avatar benwr commented on July 30, 2024

I think this could be a relatively straightforward change to the produce_cards function; it might require also doing some work to make the card type configurable. I don't know that I'll have time to do this myself any time soon, but I'm not opposed to its addition if you wanted to make the changes, and would review a PR.

from ankdown.

sandersantema avatar sandersantema commented on July 30, 2024

I've come up with a solution but since I barely know any Python I really don't think it's any good, but it works! I don't know any git either so I'll just post it here for others who want a quick fix or don't know any python either. Besides that I'll try to look into the produce_cards function and see if I can come up with a proper solution.

I've placed this at the end of the determine_media_references(self): definition (def?)

            self.fields[i] = re.sub(r'<p>', '', current_stage)
            self.fields[i] = re.sub(r'</p>', '', current_stage)
            self.fields[i] = re.sub(r'[%].*\n', '', current_stage)

Line 1 and 2 replace the paragraph stuff. About line 3: when I put text after the percent sign it treats that line as a field and puts it in the fields array, line 3 edits it out of the fields array by searching for the percent sign until the linebreak regardless of the contents.

As I said this is really hacky but for the moment it works.

from ankdown.

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.