Hack Forums
Remove whitespace/spam filter for code and PHP tags. - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hack Forums Official Information (https://hackforums.net/forumdisplay.php?fid=1)
+--- Forum: Site News (https://hackforums.net/forumdisplay.php?fid=2)
+---- Forum: Suggestions and Ideas (https://hackforums.net/forumdisplay.php?fid=134)
+---- Thread: Remove whitespace/spam filter for code and PHP tags. (/showthread.php?tid=3521522)



Remove whitespace/spam filter for code and PHP tags. - Phizo - Jun 1, 2013

I'm unsure if this has been suggested already; I apologise if it has been.

This has been annoying me for quite sometime, so I thought I would attempt to do something about it by suggesting the elimination of it within these two tags for code readability and elegancy.
It also can potentially make code posted unusable if it contains large numbers consisting of many zeroes, for example.

What is your input on this?
It shouldn't be hard to implement, and there's no point having those tags if it can ruin code or its readability by removing whitespace.
I, for one, don't want to have to pastebin everything.


* - kalandershihabrocker - Jun 1, 2013

i agree on this. Hope some admin see's this.


* - Goodies - Jun 1, 2013

Code
Does
  Code tags.   Count  White spaces?
Test^^

PHP Code

<?php 
Does 
  Php tags
.   Count  White spaces? 
Test^^

If those removed the white spaces than I am all for this


It doesn't remove the white spaces, but I may just be an idiot and am not fully understanding what you mean.


* - Phizo - Jun 1, 2013

(Jun 1, 2013 10:05 PM)Goodies Wrote:  
Code
Does
  Code tags.   Count  White spaces?
Test^^

PHP Code

<?php 
Does 
  Php tags
.   Count  White spaces? 
Test^^

If those removed the white spaces than I am all for this


It doesn't remove the white spaces, but I may just be an idiot and am not fully understanding what you mean.

I wrote one million in the following, some zeroes should be removed when I submit the post:
Code
100

This one is self explanatory:
PHP Code

<?php 
I  am  using  six  spaces  between  each  word
. 



* - 'Snorlax - Jun 2, 2013

Yep, I'd like to see this implented too.


* - Emylbus - Jun 2, 2013

For some reason I thought spacing did work. Hold on testing...

Code
def thisIsATest():
    oneOfTheAnnoyingThings():
  if(YouUsePython):
    if(YouWantToUseWhiteSpace):
    IsItAnIssue = False

PHP Code

<?php 
long WhatIfWantLargeNumbers 
= 100
x 
= WhatIfIWantLargeNumbers * 100 

Edit: nope. It shows properly in preview though :( I want my Python whitespace!


* - Tidas - Jun 2, 2013

Already been suggested and denied before.


* - Emylbus - Jun 2, 2013

I looked up some identical requests and found these:

Omni responded to one of them as such:
(Mar 6, 2013 12:29 AM)Omniscient Wrote:  This is a shortcoming of MyBB. I actually preferred their 1.4x code tag which didn't place it inside a small window.

code=php tags are no good because it assumes we'll have syntax for other languages which we don't. There is a plugin which sort of worked but that's gonna add load for parsing imho. I did consider adding it at one point though.

MyBB uses the built in functions for php syntax.
http://php.net/manual/en/function.highlight-string.php

Geshi is one of the nicer libs but I fear running it would lead to exploits. And again the load imho isn't worth it...at least not yet. I'm hoping MyBB does more for syntax highlighting in future versions.

I'd love to add this too but it's not very simple with Prototype (MyBB's current javascript lib). However when 1.8x is released it will use JQuery which should make it easier. If you can do it without core edits for MyBB I'll consider using your code.

I guess we just need to hope that MyBB will make changes that Omni feels more comfortable with.


* - Phizo - Jun 2, 2013

(Jun 2, 2013 02:48 PM)Emylbus Wrote:  I looked up some identical requests and found these:

Omni responded to one of them as such:

I guess we just need to hope that MyBB will make changes that Omni feels more comfortable with.

Thank you for posting that.
I suppose I'll just close this, as Omniscient's response to the other thread justifies his reason for not already implementing it.
I hope to see a workaround in the future.