Bottom Page

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:
İmage
#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

[icode]Multiline
shouldn't work
[/icode]

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
snippsat likes this post
#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.
#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
metulburr likes this post
#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.
#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.
#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
#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

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  simple solved plugin metulburr 47 1,323 May-18-2019, 11:00 AM
Last Post: metulburr
  solved prefix tag/ mysupport plugin metulburr 13 790 Mar-30-2019, 07:02 PM
Last Post: micseydel
  testing support plugin metulburr 9 336 Mar-21-2019, 11:48 AM
Last Post: metulburr
  BBCode tags NLittle17 5 712 Jan-07-2019, 11:02 PM
Last Post: Larz60+
  People Not Using Code Tags micseydel 16 2,044 Dec-09-2017, 06:49 AM
Last Post: micseydel
  Just a trial. For learning code tags sylas 3 1,298 Sep-25-2017, 11:41 AM
Last Post: metulburr
  Weird Python tags syntax coloring bug micseydel 4 1,791 Jun-02-2017, 05:04 AM
Last Post: nilamo
  note moderator instead of mod tags metulburr 7 1,854 Apr-11-2017, 01:05 PM
Last Post: metulburr
  Please use code tags Larz60+ 28 5,670 Apr-06-2017, 09:47 PM
Last Post: metulburr
  Adding YourCode plugin metulburr 1 1,171 Mar-23-2017, 02:17 PM
Last Post: metulburr_testing

Forum Jump:


Users browsing this thread: 1 Guest(s)