inherit
172351
0
Sept 5, 2019 10:56:35 GMT -8
DarkPikachu
Complexity == Fun
320
October 2011
tcll
|
Post by DarkPikachu on Oct 18, 2014 19:41:13 GMT -8
this is an issue I've been dealing with for a while, mainly with my real-time BBC preview plugin...
I submit this:
random text
[table][tbody] [tr][td]blah[/td][td]blah[/td][/tr] [tr][td]blah[/td][td]blah[/td][/tr] [tr][td]blah[/td][td]blah[/td][/tr] [/tbody][/table]
which internally gets converted to:
random text<br> <br> <table><tbody><br> <tr><td>blah</td><td>blah</td></tr><br> <tr><td>blah</td><td>blah</td></tr><br> <tr><td>blah</td><td>blah</td></tr><br> </tbody></table>
but AS SOON as JQuery handles this, this happens:
random text<br> <br> <br> <br> <br> <br> <table><tbody> <tr><td>blah</td><td>blah</td></tr> <tr><td>blah</td><td>blah</td></tr> <tr><td>blah</td><td>blah</td></tr> </tbody></table>
how do I deal with this w/o JQuery??
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Oct 20, 2014 8:13:47 GMT -8
Looks like jQuery is trying to correct the invalid HTML from your second code block. Try submitting the first code block without line breaks, should clear it right up.
|
|
inherit
172351
0
Sept 5, 2019 10:56:35 GMT -8
DarkPikachu
Complexity == Fun
320
October 2011
tcll
|
Post by DarkPikachu on Oct 22, 2014 16:38:57 GMT -8
not sure what you mean by that :/
the second code-block is text :/ how can I remove the line breaks??
*rethinks* waaait, IK what you mean:
random text
[table][tbody][tr][td]blah[/td][td]blah[/td][/tr][tr][td]blah[/td][td]blah[/td][/tr][tr][td]blah[/td][td]blah[/td][/tr][/tbody][/table]
^that would be a work-around... but not a fix
I want to remove the invalid br tags... heh how can I do this??
EDIT: or perhapse perform the initial '/n' >>> '<br>' conversion last?? >.>
1: convert HTML escapes 2: basic BBC conversion 3: pass to jquery as node 4: update node.html() replacing '/n'
right??
EDIT2: no, but it gives me something to work with :3
EDIT3: this just in, it's not JQuery, it's chrome!
node[0].innerHTML = str.replace(/\n/g, '<br>') ^ this makes things difficult >_<
dangit, why must this second square be so far away, where can I get a plank... >.> <_<
|
|