|
@@ -519,25 +519,17 @@ export function createTableAsciiArt( model, table ) {
|
|
|
for ( let column = 0; column <= lastColumn; column++ ) {
|
|
for ( let column = 0; column <= lastColumn; column++ ) {
|
|
|
const cellInfo = tableMap[ row * columns + column ];
|
|
const cellInfo = tableMap[ row * columns + column ];
|
|
|
|
|
|
|
|
- if ( cellInfo.rowspan > 1 || cellInfo.colspan > 1 ) {
|
|
|
|
|
- for ( let subRow = row; subRow < row + cellInfo.rowspan; subRow++ ) {
|
|
|
|
|
- for ( let subColumn = column; subColumn < column + cellInfo.colspan; subColumn++ ) {
|
|
|
|
|
- const subCellInfo = tableMap[ subRow * columns + subColumn ];
|
|
|
|
|
|
|
+ const isColSpan = cellInfo.anchorColumn != cellInfo.column;
|
|
|
|
|
+ const isRowSpan = cellInfo.anchorRow != cellInfo.row;
|
|
|
|
|
|
|
|
- subCellInfo.isColSpan = subColumn > column;
|
|
|
|
|
- subCellInfo.isRowSpan = subRow > row;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- gridLine += !cellInfo.isColSpan || !cellInfo.isRowSpan ? '+' : ' ';
|
|
|
|
|
- gridLine += !cellInfo.isRowSpan ? '----' : ' ';
|
|
|
|
|
|
|
+ gridLine += !isColSpan || !isRowSpan ? '+' : ' ';
|
|
|
|
|
+ gridLine += !isRowSpan ? '----' : ' ';
|
|
|
|
|
|
|
|
let contents = getElementPlainText( model, cellInfo.cell ).substring( 0, 2 );
|
|
let contents = getElementPlainText( model, cellInfo.cell ).substring( 0, 2 );
|
|
|
contents += ' '.repeat( 2 - contents.length );
|
|
contents += ' '.repeat( 2 - contents.length );
|
|
|
|
|
|
|
|
- contentLine += !cellInfo.isColSpan ? '|' : ' ';
|
|
|
|
|
- contentLine += !cellInfo.isColSpan && !cellInfo.isRowSpan ? ` ${ contents } ` : ' ';
|
|
|
|
|
|
|
+ contentLine += !isColSpan ? '|' : ' ';
|
|
|
|
|
+ contentLine += !isColSpan && !isRowSpan ? ` ${ contents } ` : ' ';
|
|
|
|
|
|
|
|
if ( column == lastColumn ) {
|
|
if ( column == lastColumn ) {
|
|
|
gridLine += '+';
|
|
gridLine += '+';
|