Giter Site home page Giter Site logo

Multiline formatting about bb-ruby HOT 2 CLOSED

cpjolicoeur avatar cpjolicoeur commented on August 30, 2024
Multiline formatting

from bb-ruby.

Comments (2)

cpjolicoeur avatar cpjolicoeur commented on August 30, 2024

Would love a pull request with a fix on this. Or at least a failing test case we can add the fix against.

from bb-ruby.

FreeApophis avatar FreeApophis commented on August 30, 2024

Yeah a nasty little bugger - it is one of the reasons I wanted to change to a library because it is pretty tricky: I have the same Problem with the "Code"-Tag.

It produces illegal html in quite many cases. The code tag is an inline tag like a span, so for multiline code you would need to wrap it in a PRE-tag, I have tried such a filter, it makes the HTML mess worse.

it produces BR-tags in the PRE-environment which makes every line brake twice, and a multi line break produces the illegal P-tag as described above.

The problem is the rails formatting method which does not care about the meaning of HTML - and so it does not even matter if you make the bb formatting before or after you call the formatting method.

I don't think there is an easy solution to this. I just wanted to report that I also ran into this - and I will just live with the broken HTML.

This is a more general problem underlying that this is not a real BB parser, but just a regex-hack. I was looking for a real BB parser, but it seems there is none for Ruby/Rails.

You probably should fix this as Won't Fix, because it is a fundamental problem you will not be able to solve with Regular Expression. The Problem is outside of a Type-3 Grammer. If someone could point me to a real Parser for BB code, this would be real helpful.

Thanks.

PS: I found rbb which is a real parser based on treetop, however not enough features for me.

from bb-ruby.

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.