Skip to content

added support for richtext#38

Open
FelixMook wants to merge 1 commit into
pofider:masterfrom
FelixMook:master
Open

added support for richtext#38
FelixMook wants to merge 1 commit into
pofider:masterfrom
FelixMook:master

Conversation

@FelixMook

Copy link
Copy Markdown

with this support it is possible to use richtext from exceljs

@pofider

pofider commented Oct 23, 2020

Copy link
Copy Markdown
Owner

Thank you for the PR!
I see the benefit. Multiple text parts with different styles in a single cell aren't supported now.

This is quite a fast solution for the problem, but I'm not sure how I like how the input HTML would look like then.
This is a bit ugly mix.

<td data-cell-type="rixtext">
{
  'richText': [
    {'font': {'size': 12,'color': {'theme': 0},'name': 'Calibri','family': 2,'scheme': 'minor'},'text': 'This is '}, 'format'}
  ]
}
</td>

I think I would rather prefer if we support multiple span elements inside a single cell like this.

<td>
   <span style='color: red'>I am red</span>
   <span style='color: blue'>I am blue</span>
</td>

What you think about it?

@FelixMook

FelixMook commented Oct 26, 2020

Copy link
Copy Markdown
Author

This solution is the cleaner way, but I think it will be hard to convert the css-style in the format for the richtext.
We could also think about a custom element like this:

<td>
   <span richtext-style=" {'font': {'size': 12,'color': {'theme': 0},'name': 'Calibri','family': 2,'scheme': 'minor'} ">This is the text</span>
</td>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants