-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] add option to convert bbcode to markdown #23
Conversation
|
||
This is an image: ![Image](http://example.com/foo.png) | ||
|
||
> This *is* a quotation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current treetop node structure does not allow to have these quotes per line. I need some help here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. Do you still need help with this? If so, could you elaborate on what you're trying to do and what problems you ran into?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this is still marked as WIP. I take it it's not ready for me to review and merge into master yet. Please let me know if I'm mistaken.
Yes, still open. So the goal is to translate
into
My thinking went in to directions to achieve this. Either by replacing the newlines within the block node to |
Ah, thanks for pointing that out. So tell me if I'm understanding this correctly: In BBCode, the string Did I get that right? If so, then I think your second option is the way to go. I.e. we'll have to extend the |
BTW, I added comments to |
Good point, markdown's handling of when to paragraph and when to line breaks got me a few times already. It's documented here: https://www.markdownguide.org/basic-syntax/#paragraphs-1
would actually become
While
should become
(Note the double-spaces behind the "a") |
Btw, what is the minimum supported ruby version of the gem? I'd tend to go for 2.5 given everything older is EOL |
4020410
to
2deb40a
Compare
|
||
def expected_markdown | ||
<<-EOS | ||
**This *is* awesome** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails at the moment and creates the line **This [i]is[/i] awesome**
Something in the recursive detection seems to be broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think this should be doable if we extend the .treetop
file.
I agree with supporting nothing earlier than Ruby 2.5. I wrote this gem a long time ago and didn't get around to updating its dependencies. I'm going to try to pull from your repo, see if there's anything else needing updates, and then push to master with all dependencies updated.
What's the rationale for the commit removing sanitization (Dahie@d19b450)? |
By the way, when I updated Treetop to the latest version (1.6.10), I started getting the following error upon compiling the
After a quick look at Beyond that, I updated all dependencies and pushed to master. |
I ran into the same issue trying to update treetop and decided to stick with the old version. Good enough. |
You can ignore the other branches in my repo. They were some experiments, but not for merging. |
Ok great, thanks! I'd suggest you pull from my master branch when you have
a chance, since that'll get you all the updated dependencies. It shouldn't
impact your new-feature development either way, though.
I'll give some thought to the best way to extend the .treetop file.
…On Mon, Jun 1, 2020 at 3:30 AM Daniel Senff ***@***.***> wrote:
What's the rationale for the commit removing sanitization ***@***.***
<Dahie@d19b450>
)?
You can ignore the other branches in my repo. They were some experiments,
but not for merging.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#23 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAD6UF4KWYUNZ5JXIVJQITRUNKIPANCNFSM4NBTKRSQ>
.
|
This is taking me longer than I expected, but I have a partly working implementation on the master branch. I pulled from your repo, did some refactoring, and made an attempt at solving the blockquote problem. But there are still some bugs with paragraphs and line breaks. I'll keep working on those. |
I think I've worked out the paragraph and line-break bugs. Let me know what you think. We may be close to releasing a new version with Markdown support. |
Thank you looks very good! Only, the readme does not mention the markdown output feature and how to use it. Feel free to close my PR when you release the new version :) |
The new version (1.1.0) is released. Thanks again for your help! |
This is still work in progress, but shows a possible direction discussed in #22
The tests are failing at the moment. I have a bit of a hard time with Treetop, it's documentation is … sparse with a steep learning curve.