Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for richtext #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

FelixMook
Copy link

with this support it is possible to use richtext from exceljs

@pofider
Copy link
Owner

pofider commented Oct 23, 2020

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
Copy link
Author

FelixMook commented Oct 26, 2020

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