diff --git a/packages/ripple-tide-api/src/utils/markup-transpiler/cheerio.test.ts b/packages/ripple-tide-api/src/utils/markup-transpiler/cheerio.test.ts index f21e09156..bf2c3be28 100644 --- a/packages/ripple-tide-api/src/utils/markup-transpiler/cheerio.test.ts +++ b/packages/ripple-tide-api/src/utils/markup-transpiler/cheerio.test.ts @@ -3,6 +3,7 @@ import markupTranspiler from './index' const markup = { table: ` + @@ -26,6 +27,7 @@ const markup = { const fixed = { table: `
FnameLname
JoeCool
+ diff --git a/packages/ripple-tide-api/src/utils/markup-transpiler/default-plugins.ts b/packages/ripple-tide-api/src/utils/markup-transpiler/default-plugins.ts index 7f8431db8..0726c1871 100644 --- a/packages/ripple-tide-api/src/utils/markup-transpiler/default-plugins.ts +++ b/packages/ripple-tide-api/src/utils/markup-transpiler/default-plugins.ts @@ -5,6 +5,16 @@ const pluginTables = function (this: any) { // Wrap tables with a div. this.find('table').map((i: any, el: any) => { const $table = this.find(el) + + $table.find('col[data-width]').each((i: any, col: any) => { + const $col = this.find(col) + const colWidth = $col.attr('data-width') + + if (colWidth) { + $col.attr('style', `width: ${colWidth}`).removeAttr('data-width') + } + }) + return $table .wrap(`
`) .wrap(
FnameLname
JoeCool