*Magnify*
SPONSORED LINKS
Printed from https://writing.com/main/forums/message_id/2145942
Rated: ASR · Message Forum · Writing.Com · #102362
Drop your new ideas into the Writing.Com Suggestion Box!
<< Previous  •  Message List  •  Next >>
Reply  •  Post New
Oct 4, 2010 at 4:25pm
#2145942
Edited: October 4, 2010 at 4:36pm
Re: Re: TABLES
by A Non-Existent User
Ah, that makes perfect sense.


Don't you do "completeness" checks when you parse the WritingML?

I believe I recall noticing that if one half of a pair is omitted - e.g. one of {quote} or {/quote} - the other gets ignored.

If so, would that help out here?


How about this. Use the following new writingML codes:

{table}
{cell:width}
{/table}

If {table} or {/table} is missing, then do the usual trick of not performing any substitutions.

Don't let users nest tables - simply parse from a {table} to the next {//table}


Then the following substitutions should do the trick:

{table} = <TABLE><TR><TD WIDTH=0>
{cell:width} = </TD><TD WIDTH=width>
{/table} = </TD></TR></TABLE>


By ensuring that both {table} and {/table} are present for substitutions to occur, you prevent any HTML table codes being generated unless properly bracketed within a new table.

Because a new table and row are generated only by the {table} pair, and because there is no nesting, you can be certain that, if they are present, anything the user enters will be safely "buffered" from the surrounding HTML code in its own single-row table.

Because there is the single {cell} command dividing the columns, the user can't "sneak" anything in. Everything within this table will necessarily be wrapped by one or more <TD> fields.

(And, actually, if that works, there's no reason, I suppose, not to go ahead and add a {row} that substitutes to </TD></TR><TR><TD WIDTH=0>)



Might that do the trick?

Admittedly, it's fairly rudimentary. But, really, that's all that users will need 99% of the time, I should think.


LP
MESSAGE THREAD
TABLES · 10-04-10 3:07pm
by A Non-Existent User
Re: TABLES · 10-04-10 3:30pm
by The StoryMaster
Re: Re: TABLES · 10-04-10 4:24pm
by Jeff
Re: Re: Re: TABLES · 10-04-10 4:38pm
by The StoryMaster
Re: Re: Re: Re: TABLES · 10-04-10 4:55pm
by A Non-Existent User
Re: Re: Re: Re: Re: TABLES · 10-04-10 5:06pm
by The StoryMaster
Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 12:29am
by A Non-Existent User
Re: Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 1:03am
by The StoryMaster
Re: Re: Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 1:17am
by A Non-Existent User
Re: Re: Re: Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 1:27am
by The StoryMaster
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 2:14am
by A Non-Existent User
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: TABLES · 10-05-10 10:09am
by A Non-Existent User
*Star* Re: Re: TABLES · 10-04-10 4:25pm
by A Non-Existent User
Re: Re: Re: TABLES · 10-04-10 4:36pm
by The StoryMaster

The following section applies to this forum item as a whole, not this individual post.
Any feedback sent through it will go to the forum's owner, The StoryMistress.
Printed from https://writing.com/main/forums/message_id/2145942