Python Forum
Created a plugin for our code tags
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Created a plugin for our code tags
#1
I've created a plugin for our python, error, output, and icode tags.
The plugin makes sure no further processing happens inside these tags, and also makes sure <br> tags are not added (using a nasty hack, but php itself is a nasty hack, so whatever...).

I don't have the time right now to fiddle with snapshots, forum settings and styles, but I'll be updating the forum tomorrow.
For now, you just get a screenshot o a test post from a local MyBB install:
[Image: uOtvVXx.png]
#2
Testing the settings:

import sys
<mybb-code>
<mybb_code>

Does <newline> here get replaced?

print sys.argv
Adding a br here
makes sense

Non python <mybb-code>
code
Does <newline> here get replaced?

Multiline allowed
php should also work

<mybb-code>
<mybb_code>
single Does <newline> here get replaced? line ok

Multiline
shouldn't work


Output:
Some output here anda new line
Error:
Some error here
Other tags shouldn't work here:
not [i]italic[/i]
Does <newline> here get replaced?
not 
[code]code[/code]
As a result of a hack, <whatever> gets replaced with a newline in source code, like so: first line <whatever> second line
#3
The plugin has been activated and seems to be working fine (with class_parser.php reverted to original)

As a result, code and php tags, as well as ©, ™ and ® symbols have been re-enabled.
I think that is a benefit rather than problem, but if anyone disagrees, let me know...

Also let me know if you notice any bugs.
#4
there seems to be a problem with missing <br> tags in error, output, and regular code tags now...
http://python-forum.io/Thread-Trouble-ma...09#pid6009
http://python-forum.io/Thread-Trouble-ma...95#pid5995

Also the php sceditor button image is a python logo, making it confusing. Last i checked the community mostly agreed that they didnt want code and php tags, only the python syntax codebox.
Recommended Tutorials:
#5
There problems that metulburr mention need to be fixed.

Here are problem as a reference. 
There are also problem with preview(look like a mess) to what you get.
And there are some new line problem outside of code boxes.
It messing up quite a lot stranac Undecided
Please revert and test better.

The original code,should not be active.
test
The old php code box should not be active.
Should not be here
Error tag is wrong:
Error:
123 456 789
Output tag is wrong:
Output:
aaaaaa bbbbbbbbbbbbbbbbb ccccccccc
Python tag ok:
import time

def time_code():
    start = time.clock()
    time.sleep(5)
    end = time.clock()
    print 'Code time {:.2f} seconds'.format(end - start)

time_code()
Spoiler tag ok:

Inline code tag do not work,but do not work in preview.:
12345678
#6
Quote:The original code,should not be active.
Code:
test


even if it was decided to stay active, there are not break tags in them anymore just like error and output tags
line 1
line 2
line 3
EDIT:
This is also one of the worst times to edit and verify accuracy as the change occurred around 8AM EST when a lot of people start posting.
Recommended Tutorials:
#7
Ok, I"ll revert the changes as soon as I get to a computer.

The output and error tags were working fine on my local mybb, so I guess there's a plugin conflict or a missed css rule somewhere.
The preview part might require some work though, as it will probably require some digging into the editor code, since it (for some strange reason) doesn't use the same parsing code.

As for code and php tags, I thought it would be nice to have an alternative for posting non-python code, but if everyone disagrees, I'll just change them into python like before.

metulburr Wrote:This is also one of the worst times to edit and check as the change occurred around 8AM EST when people start posting.
For me, it's either that or making changes in the early afternoon EST and not geting feedback until next day, so...
#8
Quote:The output and error tags were working fine on my local mybb, so I guess there's a plugin conflict or a missed css rule somewhere.
I dont think there is a plugin that modifies MYcode at all, at least not enabled and installed. 

Quote:As for code and php tags, I thought it would be nice to have an alternative for posting non-python code, but if everyone disagrees, I'll just change them into python like before.
i cant find the thread, but its somewhere in Board. Mostly everyone just want python code box and not the others.
Recommended Tutorials:
#9
EDIT:
Found the actual poll thread
http://python-forum.io/Thread-More-codebox-issues

the syntax highlighter codebox has grown on me...though i am still not fond of the WYSIWYG editor
Recommended Tutorials:
#10
(Dec-09-2016, 05:37 PM)metulburr Wrote: I dont think there is a plugin that modifies MYcode at all, at least not enabled and installed. 
Well, something is removing newlines, which doesn't happen in vanilla MyBB.
It could take a bit of digging to determine what that something is.

Even if there is nothing that modifies MyCode specifically, there are plugins that modify the posts.

(Dec-09-2016, 05:42 PM)metulburr Wrote: the syntax highlighter codebox has grown on me...though i am still not fond of the WYSIWYG editor
Yeah, I don't like the WYSIWYG editor either, but fortunately it can be turned off.
As for syntax highlighting, I had that on the old forum as well, by using a userscript.

I've reverted all the changes for now, and I'll try debugging when I have more time


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Verify users plugin itsmeJAY 3 2,689 Jun-22-2019, 09:11 PM
Last Post: metulburr
  simple solved plugin metulburr 47 14,941 May-18-2019, 11:00 AM
Last Post: metulburr
  solved prefix tag/ mysupport plugin metulburr 13 7,150 Mar-30-2019, 07:02 PM
Last Post: micseydel
  testing support plugin metulburr 9 4,558 Mar-21-2019, 11:48 AM
Last Post: metulburr
  People Not Using Code Tags micseydel 16 8,041 Dec-09-2017, 06:49 AM
Last Post: micseydel
  Just a trial. For learning code tags sylas 3 3,645 Sep-25-2017, 11:41 AM
Last Post: metulburr
  Please use code tags Larz60+ 28 15,540 Apr-06-2017, 09:47 PM
Last Post: metulburr
  Adding YourCode plugin metulburr 1 3,803 Mar-23-2017, 02:17 PM
Last Post: metulburr_testing
  Do not know how to add "Code Tags" or "Error Tags" to my submissions mattkrebs 2 3,675 Mar-21-2017, 04:15 PM
Last Post: metulburr
  support plugin solved/best answer/etc metulburr_testing 12 9,253 Oct-08-2016, 04:29 PM
Last Post: Kebap

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020