Skip to content

Commit a75b80f

Browse files
committed
fixed hyperlink color
1 parent 4b9b546 commit a75b80f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/gen-objects.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,8 +822,10 @@ export function addTableDefinition(
822822
opt.fontSize = opt.fontSize || DEF_FONT_SIZE
823823
opt.margin = opt.margin === 0 || opt.margin ? opt.margin : DEF_CELL_MARGIN_IN
824824
if (typeof opt.margin === 'number') opt.margin = [Number(opt.margin), Number(opt.margin), Number(opt.margin), Number(opt.margin)]
825-
// NOTE: dont add default color to autoPage tables - it causes any textObj's with hyperlinks to have subsequent words to be black
826-
if (!opt.color && !opt.autoPage) opt.color = opt.color || DEF_FONT_COLOR // Set default color if needed (table option > inherit from Slide > default to black)
825+
// NOTE: dont add default color on tables with hyperlinks! (it causes any textObj's with hyperlinks to have subsequent words to be black)
826+
if (JSON.stringify({ arrRows: arrRows }).indexOf('hyperlink') === -1) {
827+
if (!opt.color) opt.color = opt.color || DEF_FONT_COLOR // Set default color if needed (table option > inherit from Slide > default to black)
828+
}
827829
if (typeof opt.border === 'string') {
828830
console.warn('addTable `border` option must be an object. Ex: `{border: {type:\'none\'}}`')
829831
opt.border = null

0 commit comments

Comments
 (0)