[CDB] Markdown

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
nou nou
Registered User
Posts: 494
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][DEV] Markdown

Post by nou nou »

AbaddonOrmuz wrote: Tue Jan 22, 2019 8:44 pm Yes user group permissions, I think he meant that only administrators or moderators could use this feature, for example.

That's what I thought - just trying to make sense of that idea for myself...

So how would that work in practice? Based on user's permissions something gets displayed one way or another but the content can be the same? Seems a bit of a resource hog for starters.

But more important, when people who don't have that permission, post something in markdown, you get posts with raw markdown? What if someone quotes someone else with a markdown post?

I see a very clear benefit with a per-forum permission, but per-group? Not so much (yet :))...
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1302
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: [3.2][DEV] Markdown

Post by AlfredoRamos »

nou nou wrote: Tue Jan 22, 2019 10:54 pm So how would that work in practice? Based on user's permissions something gets displayed one way or another but the content can be the same? Seems a bit of a resource hog for starters.
Well, it would take just one or a few more checks, I don't think it would use more resources, all is done with PHP, no database is involved.
nou nou wrote: Tue Jan 22, 2019 10:54 pm But more important, when people who don't have that permission, post something in markdown, you get posts with raw markdown? What if someone quotes someone else with a markdown post?
The permission, and other checks, are done before the message is parsed so if a user is not allowed to use Markdown it will simply show the text as is (plain text, no Markdown), the same applies to quotes.

With the current version you can test quoting a Markdown post after disabling it in your UCP settings.
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
nou nou
Registered User
Posts: 494
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][DEV] Markdown

Post by nou nou »

AbaddonOrmuz wrote: Wed Jan 23, 2019 4:18 am The permission, and other checks, are done before the message is parsed so if a user is not allowed to use Markdown it will simply show the text as is (plain text, no Markdown), the same applies to quotes.

With the current version you can test quoting a Markdown post after disabling it in your UCP settings.
Ah OK, I see that now. Neat - I hadn't noticed the option before.

Little weird though, because you would end up with someone quoting a nicely marked up piece of text and then reply with something that looks like mambo-jumbo. Anyway I'm sure someone could come up with a use case for that and if it doesn't take up a lot of resources anyway I'm all for it :)
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: [3.2][DEV] Markdown

Post by 3Di »

AbaddonOrmuz wrote: Tue Jan 22, 2019 8:58 pm
3Di wrote: Tue Jan 22, 2019 8:53 pm Yes, I will give you an example tomorrow :) or you can have a look at the ABBC3 extension AFAIR.
Thanks :cool:

Will check ABBC too.
While I am sure this can be done with BBcodes
($my_condition) ? $parser->enable_bbcode('my_bbcode') : $parser->disable_bbcode('my_bbcode');
that's doesn't seems to be your case after having read your repo. I apologize for the false alarm. :|

Well, could be potentially possible with some ugly block of code but not with the above facility, as far as I have seen at github.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1302
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: [3.2][DEV] Markdown

Post by AlfredoRamos »

3Di wrote: Wed Jan 23, 2019 3:17 pm While I am sure this can be done with BBcodes
($my_condition) ? $parser->enable_bbcode('my_bbcode') : $parser->disable_bbcode('my_bbcode');
that's doesn't seems to be your case after having read your repo. I apologize for the false alarm. :|

Well, could be potentially possible with some ugly block of code but not with the above facility, as far as I have seen at github.
It's ok.

I'll try using normal user permissions, I'll see where it leads me :lol:
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1302
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: [3.2][DEV] Markdown

Post by AlfredoRamos »

Version 0.4.0-dev released, see the changelog.
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
nou nou
Registered User
Posts: 494
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][DEV] Markdown

Post by nou nou »

Hmm odd, doesn't seem to work anymore.

I can see the forum permission, it's set to yes. The Markdown status is ON in the editor, but the result of a post is just raw output. The UCP option is also missing.

As FYI, I updated the extension though did not delete the data after disabling v0.3...
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1302
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: [3.2][DEV] Markdown

Post by AlfredoRamos »

nou nou wrote: Wed Jan 23, 2019 11:47 pm As FYI, I updated the extension though did not delete the data after disabling v0.3...
Try doing a clean install by disabling, deleting data and then enabling the extension again.

I modified the old migration file to add the new permissions, I think old migration files does not get triggered when updating, only the new ones, so maybe that's why.

I'll add a note in the first post.

Edit: Yep, I confirm that doing a clean install fixes the issue.
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
nou nou
Registered User
Posts: 494
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][DEV] Markdown

Post by nou nou »

Hm. Something is borked here.

So I did a disable -> delete data -> enable on v0.4 but that didn't help.

Then I diabled, deleted data, re-uploaded v0.3 and tested that. That worked. UCP default option is there again.

Disabled -> del data 0.3 -> upload v0.4 and enable. Markdown works.

However, I cannot disable it - the disable Markdown button in the post editor has no effect.
Also, the default posting UCP option is not there in v0.4.
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1302
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: [3.2][DEV] Markdown

Post by AlfredoRamos »

nou nou wrote: Thu Jan 24, 2019 6:39 pm Hm. Something is borked here.
Yes, that was an oversight of my part.

It has been fixed in version 0.5.0-dev, and I added functional tests to avoid that from happening again.

Please, do a clean install again, just in case.
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
nou nou
Registered User
Posts: 494
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][DEV] Markdown

Post by nou nou »

Oooh. You are fast :)

All is working again! Couple of issues with this version.

The disable markdown switch in the post editor isn't working. Markdown is always on, unless you turn it off in the UCP.

Markdown shows as ON in the post editor even when the default is off in UCP.

One request - would you consider adding support for the quick reply extension?

Thanks!
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1302
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: [3.2][DEV] Markdown

Post by AlfredoRamos »

nou nou wrote: Fri Jan 25, 2019 1:57 am The disable markdown switch in the post editor isn't working. Markdown is always on, unless you turn it off in the UCP.
Just to be sure, If you check "Disable Markdown" and then click Preview or Submit doesn't it show it as plain text? I can't reproduce that issue.

Which phpBB and PHP version are you using?
nou nou wrote: Fri Jan 25, 2019 1:57 am Markdown shows as ON in the post editor even when the default is off in UCP.
That's intended, it shows if the feature is enabled and has permissions to use it, it does not take into account user preferences.

It tries to mimic what the BBCode settings does, if you disable BBCode in the UCP it still shows "BBCode is ON".
nou nou wrote: Fri Jan 25, 2019 1:57 am One request - would you consider adding support for the quick reply extension?
Not for now, I'm currently trying to get it working as it should and polish it, but I will add it in my to-do list.
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
nou nou
Registered User
Posts: 494
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][DEV] Markdown

Post by nou nou »

AbaddonOrmuz wrote: Fri Jan 25, 2019 9:10 pm Just to be sure, If you check "Disable Markdown" and then click Preview or Submit doesn't it show it as plain text? I can't reproduce that issue.

Which phpBB and PHP version are you using?
No, it shows as Markdown... 3.2.5 and php7.1

It's possible that it's something else. I have more than 60 extensions running on my test site so I'll look into disabling a few... :)
AbaddonOrmuz wrote: Fri Jan 25, 2019 9:10 pm It tries to mimic what the BBCode settings does, if you disable BBCode in the UCP it still shows "BBCode is ON".
Right. Gotcha. Ok that's fine - I thought maybe the issues were related.
AbaddonOrmuz wrote: Fri Jan 25, 2019 9:10 pm Not for now, I'm currently trying to get it working as it should and polish it, but I will add it in my to-do list.
Great, thanks! I'm sometimes wondering if quick reply is worth it. I find it handy sometimes, but it also seems to enable a terse posting style which isn't my favourite.
User avatar
AlfredoRamos
Recognised Extension Developer
Posts: 1302
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: [3.2][DEV] Markdown

Post by AlfredoRamos »

nou nou wrote: Fri Jan 25, 2019 11:00 pm No, it shows as Markdown... 3.2.5 and php7.1
Mmm.. strange, I don't thing is related but, which style do you use?
Some of my phpBB extensions:
:chart_with_upwards_trend: SEO Metadata | Image Markdown | :shield: hCaptcha
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user | Linux Boards :penguin:
nou nou
Registered User
Posts: 494
Joined: Sat Oct 29, 2016 8:08 pm

Re: [3.2][DEV] Markdown

Post by nou nou »

Just good old Prosilver...
Locked

Return to “Extensions in Development”