Dec-08-2017, 10:25 AM
(Dec-08-2017, 12:59 AM)metulburr Wrote:Quote:is there a way to make it so that the in-browser editor automatically adds codes when, say, someone pastes three or more lines?I think this would require a lot of code that we non PHP devs seem not to be able to implement. Although that would surely fix the problem. One method i think i could implement, would be to disallow the post if the condition is met. Condition being X amount of python keywords? Or indented space...but then some people dont even make sure their code is indented. Then it would show a message saying that code was detected and code tags (ie [ python ]) were not used with a link to BBcode in a new tab to instruct how to use them if they dont know how.
And yes it closely resembles the other case...but i know how to deny a post, and not how to auto implement code tags around suspected python code. Maybe @[stranac] might know more as he seems to be much better at PHP.
Pasting code is handled entirely by the editor itself, using javascript.
You're supposed to be able to easily extend the editor according to the docs, but I experimented with it when I was writing the code tags plugin, and every change I tried to make resulted in the editor completely ignoring all MyBB specific code.
I tried asking for help in a few places, but it didn't really get me anywhere...