• Please review our updated Terms and Rules here

How to turn off WYSIWYG Post Formatting

NeXT

Veteran Member
Joined
Oct 22, 2008
Messages
8,159
Location
Kamloops, BC, Canada
I hate it. I'm multiple forums that use it and I hate it. Once it parses text in tags like images they will continue to load even in edits or previews. If you typo something well screw you, delete the broken object and type it out again. Want to highlight and copy it to a notepad? You'll have to readd all your image and formatting tags because it won't carry those over once parsed.
Other forums have it as an option in their user controls but I can't find them on here.
 
Seconded--why, when I paste a code sample with nicely formatted columns under the [code] tags, does this version of vB insist on compressing multiple spaces to single spaces? The old vB didn't do this.

The old vB had a checkbox to disable parsing of text as smilies, but this one requires me to use the [noparse] tag--which isn't even mentioned in the menu bar. e.g. :) versus :) .
 
Try the very first button called "Source". It will toggle between WYSIWYG and plain text. It does not disable parsing afterwards, but won't do fancy things like messing with pasted text.
 
Okay, let me try it:
Code:
// MakeCRC32 - Make a 32-bit CRC sum.
// ----------------------------------
//
// unsigned long MakeCRC32( void _far *buf, unsigned int len)
//

unsigned long MakeCRC32( void _far *buf, unsigned len)
{

_asm push ds
_asm mov ax,word ptr CRC_Accum
_asm mov dx,word ptr CRC_Accum+2 // get old accumulator
_asm les si,buf // buffer
_asm lds di,CRC_Table // tableq
_asm mov cx,len // length
MakeCRC2:
_asm mov bl,es:[si]
_asm inc si

_asm xor bl,al
_asm sub bh,bh
_asm shl bl,1
_asm shl bl,1 // * 4

_asm mov al,ah
_asm mov ah,dl
_asm mov dl,dh
_asm xor dh,dh // right shift 8

_asm xor ax,ds:[di+bx]
_asm xor dx,ds:[di+bx+2]
_asm loop MakeCRC2 // do it

_asm pop ds // restore registers

_asm mov word ptr CRC_Accum,ax // form return value
_asm mov word ptr CRC_Accum,dx

return CRC_Accum;

} // MakeCRC32

Nah--if I go back to edit it, even with the "Source" button selected, the result is still all mashed up. Is there a BB Code tag for source so I can bracket the pasted code and insert comments before and after?
 
Last edited:
The original looks like this:

Code:
//  MakeCRC32 - Make a 32-bit CRC sum.
//  ----------------------------------
//
//  unsigned long MakeCRC32( void _far *buf, unsigned int len)
//

unsigned long MakeCRC32( void _far *buf, unsigned len)
{

_asm	push	ds
_asm	mov	ax,word ptr CRC_Accum
_asm	mov	dx,word ptr CRC_Accum+2 // get old accumulator
_asm	les	si,buf			// buffer
_asm	lds	di,CRC_Table		// tableq
_asm	mov	cx,len			// length
MakeCRC2:
_asm	mov	bl,es:[si]
_asm	inc	si

_asm	xor	bl,al
_asm	sub	bh,bh
_asm	shl	bl,1
_asm	shl	bl,1			// * 4

_asm	mov	al,ah
_asm	mov	ah,dl
_asm	mov	dl,dh
_asm	xor	dh,dh			// right shift 8

_asm	xor	ax,ds:[di+bx]
_asm	xor	dx,ds:[di+bx+2]
_asm	loop	MakeCRC2		// do it

_asm	pop	ds			// restore registers

_asm	mov	word ptr CRC_Accum,ax	// form return value
_asm	mov	word ptr CRC_Accum,dx

  return CRC_Accum;

} // MakeCRC32
 
Test...
Code:
int
main()
{
  unsigned long c;      /* crc shift register */
  unsigned long e;      /* polynomial exclusive-or pattern */
  int i;                /* counter for all possible eight bit values */
  int k;                /* byte being shifted into crc apparatus */

  /* terms of polynomial defining this crc (except x^32): */
  static const int p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};

  /* Make exclusive-or pattern from polynomial */
  e = 0;
  for (i = 0; i < sizeof(p)/sizeof(int); i++)
    e |= 1L << (31 - p[i]);

  /* Compute and print table of CRC's, five per line */
  printf("  0x00000000U");
  for (i = 1; i < 256; i++)
  {
    c = 0;
    for (k = i | 256; k != 1; k >>= 1)
    {
      c = c & 1 ? (c >> 1) ^ e : c >> 1;
      if (k & 1)
        c ^= e;
    }
    printf(i % 5 ? ", 0x%08lxU" : ",\n  0x%08lxU", c);
  }
  putchar('\n');
  return 0;
}
Test #2: doing an edit
 
Last edited:
Odd that it does not work for you.

It even keeps indentation when editing for me.
 
One of the many reasons I consider vBull a steaming pile, as many developer forums have similar issues with mangling code. It's REALLY annoying when it's a web developer forum.

The trick I've found... lemme test that here ... to get around it screwing with your code indentation, is to first replace tabs with spaces, then put the BBCODE for the code into your editor BEFORE you copy it to the clipboard. If the opening and closing BBCODE is present, it will paste and generally not get screwed over.

Let's test... this should be mangled.

Code:
for (let details of d.querySelectorAll("#referenceIndex details")) {
let
objName = details.querySelector("summary").textContent,
cutoff = objName.length + 1;
references[objName] = { details, anchors : {} };
for (let a of details.querySelectorAll("li a")) {
let
href = a.getAttribute("href"),
offset = href.indexOf("_" + objName);
if (offset >= 0) {
references[objName].anchors[href.substr(offset + cutoff)] = a;
}
}
}

This should not:

Code:
  for (let details of d.querySelectorAll("#referenceIndex details")) {
    let
      objName = details.querySelector("summary").textContent,
      cutoff = objName.length + 1;
    references[objName] = { details, anchors : {} };
    for (let a of details.querySelectorAll("li a")) {
      let
        href = a.getAttribute("href"),
        offset = href.indexOf("_" + objName);
      if (offset >= 0) {
        references[objName].anchors[href.substr(offset + cutoff)] = a;
      }
    }
  }
 
Let's be fair here with vB: HTML does not support showing tabs, unless you convert them into an HTML entity. White-spaces (which include tabs) are condensed to a single space. That's by design. So it's more of a flaw of HTML, which software like vB needs to work around.

But yes, other software certainly does it better.
 
Let's be fair here with vB: HTML does not support showing tabs

BULLCOOKIES!

Where the devil did you get that idea? It's called "preformatted text" and is why if you're doing a block of code, the correct markup is:

Code:
<pre><code>
  Your Text Here
</code></pre>

Inside a PRE tag tabs and whitespace are preserved. CODE is phrase level, saying that "this is code" and can be used inside a sentence. PRE indicates preformatted text where all whitespace is preserved, such as carriage returns, line feeds, and of course tabs. Sadly, the default for tabs is five space equivalent though that can vary by font.

With CSS in the mix you can set the tab width with tab-size... where FINALLY Firefox has gotten off their arse and joined everyone else in the modern world on it. Just in time for Firefox to fade into oblivion since Mozilla's coffers are now empty and they're letting people go left and right. Mozilla hasn't been this irrelevant in the browser market since 2003.

The PRE behavior can also be applied to any tag with white-space : pre, or even better the "newer" (if fifteen years can be called new) pre-wrap.

So whilst you do have to escape HTML's special characters (something PHP hands you on a silver plate with htmlspecialchars) there is NO reason for them to be screwing over, much less even touching tabs. That's NONE of their business.

But that goes hand in hand with their dumbass attempts at manually fixing the width and/or height of elements, not using pre-wrap,

Seriously:

Code:
<pre class="bbcode_code" style="max-height:calc(30 * 1.4rem + 12px + 20px);">

Is ignorant incompetent nonsensical GARBAGE created by someone who likely has zero business creating a template for forum software. The mixing of metrics alone screams "Eye cans haz teh intarwebs", as does the lack of a CODE tag.

https://codepen.io/jason-knight/pen/dyWBeqV

What the devil they think they're doing screwing with tab characters is beyond me... Though such issues are commonplace when people go full Gungan slopping JavaScript in where it's unwanted, unwarranted, or just plain stupid.

Meesa says yewz nevah goes FULL Gungan.

Given how much rot is in their code, and how it's been a decade out of date for two decades, they really have giant brass donkey brass charging money for vBull. I can see why the people willing to light money on fire for forum software have moved to Xenforo.
 
Where the devil did you get that idea? It's called "preformatted text" and is why if you're doing a block of code, the correct markup is:
LOL

First, your statement doesn't even fit to my saying that you quoted. I said: "HTML does not support showing tabs". That's true, period. To this day, HTML does not even have an entity to represent a tab stop. <pre> is a block element to prevent the HTML parser to fuck up formatting. Not sure if you are even able to see that these are completely different things.

And yes, the whole reason why the <pre>-tag actually exists is exactly because HTML itself was designed to condense all white-spaces (space, tab, new line) instead of showing them. Don't argue if you have no clue about the history of HTML. <pre>,   and other stuff are kludges to work around this.

Even Mozilla tells you about this: https://developer.mozilla.org/en-US/...del/Whitespace

And just for the record: I'm doing HTML since 1997 and it's still my profession to this day.
 
Last edited:
Back
Top