Feature Request: a format preview mode that supports text preview for a table with multi-line cells
DRAFT
This comes from a request in the forum: Feature request for format preview table markup
When multi-line table cells include inline markup, the preview pane can detect this as an error, and it shows red highlighting for errors but does not attempt to show the format preview, even though there is no error. This feature would allow a way for the formatter to see a text preview despite the analyser thinking there is an error. Like in normal "text mode," <sc> tags would be suppressed, and <i> and <b> tags would be shown with _ and = respectively. Unlike the normal text mode, though, the marked up text wouldn't be highlighted. This means the parser wouldn't need to figure out what opening tag goes with what closing tag.
Proposed solution When entering preview mode in the formatting interface, enable the radio buttons for Tags, No Tags, Text, and a new button for Table Text, even if the text analyzer detects errors. (Currently these buttons are hidden if errors are detected.) For Tags, No Tags, and Text modes, do not change the current behavior. Just show the red error highlighting. For the new Table Text mode, show an actual format preview as described above. For all cases, continue to show the analyzed issue count in the Issues and Poss. Issues boxes.
It would be nice if the lack of highlighting for marked up text applies only within /* */ no-wrap tags. Outside of these tags, the format preview should be able to highlight marked up text in Table Text mode just as it does for Text mode.
The new Table Text mode should not be a configurable option for "Initial view mode", because that would risk a formatter not noticing real errors.
Out of scope This feature does not attempt to make the analyser smarter, to figure out that inline markup for multi-line table cells is not really an error.
I have a sandbox with a prototype here: https://www.pgdp.org/~mrducky/c.branch/preview_table2
@srjfoo / @70ray ^^ for a preview of the proposed functionality
Works as advertised. I still have reservations about it or whether changing the documentation to unwrap table cells woul be better. I'll make a task to discuss that.
The Table Text button is not currently disabled when Format Preview is quit. This means that an inadvertent error added between viewings of Preview could mask errors elsewhere in a page. (I'm using Chapka's example from the forums post as a starting point.)
I have reservations, also, but I'm not an expert. To clarify this, is it meant only to provide an avenue to avoid marking correctly formatted multi-line cells as an error and show alignment for the text version?
The Table Text button is not currently disabled when Format Preview is quit. This means that an inadvertent error added between viewings of Preview could mask errors elsewhere in a page. (I'm using Chapka's example from the forums post as a starting point.)
Good point, I think I understand. Seems it would be better to make preview show the red highlight for possible issues every time you enter preview mode, rather than showing Table Text mode by default if that was the last mode you used. Would that satisfy your concern?
I have reservations, also, but I'm not an expert. To clarify this, is it meant only to provide an avenue to avoid marking correctly formatted multi-line cells as an error and show alignment for the text version?
I don't understand why you have reservations, perhaps you could clarify? Yes, I believe what you said is more or less the goal. Although my proposed solution doesn't really avoid showing the "errors", it first shows the "errors" and then lets you (the formatter) click a button to hide the red highlighting and instead show a text preview mode that is helpful in assessing the layout of items on the page.
The Table Text button is not currently disabled when Format Preview is quit. This means that an inadvertent error added between viewings of Preview could mask errors elsewhere in a page. (I'm using Chapka's example from the forums post as a starting point.)
Good point, I think I understand. Seems it would be better to make preview show the red highlight for possible issues every time you enter preview mode, rather than showing Table Text mode by default if that was the last mode you used. Would that satisfy your concern?
Some of it, yes. I suspect that part of my concern is that it not break anything that currently works.
I have reservations, also, but I'm not an expert. To clarify this, is it meant only to provide an avenue to avoid marking correctly formatted multi-line cells as an error and show alignment for the text version?
I don't understand why you have reservations, perhaps you could clarify? Yes, I believe what you said is more or less the goal. Although my proposed solution doesn't really avoid showing the "errors", it first shows the "errors" and then lets you (the formatter) click a button to hide the red highlighting and instead show a text preview mode that is helpful in assessing the layout of items on the page.
Trying very hard not to let perfect be the enemy of good enough.
- I'd like to see any errors outside no-wrap disable the table text radio button
- I'd like to see block-level markup nested within no-wrap disable the table text radio button
- If, for instance, a table cell has an opening tag and no ending tag
That is, any errors outside the outside no-wrap should be resolved, as well as any block-level nesting. I'd prefer also to see any missing closing tags inside the no-wrap resolved, as that's a definite error.
Here's a test case with an example of all of the above:
<sc>Badly</b> formatted text outside no-wrap.
/*
/*
Nested
no-wrap
inside
no-wrap
*/
/#
Nested
block-quote
inside
no-wrap
#/
-----------------+------------------+---------------------------------------------------------
| ATTACK RATE. | CASE SEVERITY.
+------------------+-------+-----------+-------------+---------+-------------
| <i>Percentage of | | | | |
| persons attacked | | | <i>Confluent | |<i>Percentage
<i>Children under | amongst those | Mild. | Discrete. | Hæmorrhagic | Deaths. | Fatality.</i>
10 years.</i> | exposed in the | | | Malignant. | |
| infected houses | | | | |
| at that age.</i> | | | | |
+------------------+-------+-----------+-------------+---------+-------------
<i>Vaccinated, 33 | | | | | |
cases</i> | 5.1 | 24 | 7 | 2 | 2 | 6.0
+------------------+-------+-----------+-------------+---------+-------------
<i>Unvaccinated, | | | | | |
32 cases</i> | 56.1 | 2 | 7 | 23 | 12 | 37.5
-----------------+------------------+-------+-----------+-------------+---------+-------------
*/
Good ideas, thanks! Maybe the preview analyser can still categorize all those real errors as definite issues and always show the red highlights in that case. And the other issues inside nowrap that are currently incorrectly flagged as definite issues could be recategorized as possible issues, and only if no definite issues remain then allow table text preview.