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 HTML fragments in Document Assembler Content tag #86

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MalcolmJohnston
Copy link
Contributor

@MalcolmJohnston MalcolmJohnston commented Nov 11, 2024

Hello Sergey,

Hope you are well and thanks for merging my previous PRs.

This PR adds support for using HTML fragments with the Content tag in Document Assembler. The supported inline tags are:

  • b/strong
  • i/em
  • u
  • a
  • br

Both div and p tags are supported block level tags, any other HTML tag will simply be ignored. Tags can be combined so for example the following works:

<a href="bbc.co.uk"><b><i><u>BBC</u></i></b></a>

I have added a new test, and a tutorial to the docs site.

This resolves #70 in my opinion although as noted in the Tutorial there are some other tags that we could potentially add support for.

One thing to note is that this adds a dependency on the HTMLAgilityPack.

Any questions then let me know, I'll hopefully do another PR later in the week for supporting pulling in Document/Templates from other sources.

Cheers,
Malcolm

Updated DA Multiline content test because the HtmlConverter creates paragraphs rather than inserting soft line breaks.
…nts in a Content select (joins them with a new line).

Ran csharpier on all files.
Added HtmlAgilityPack to paket references.
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.

DocumentAssembler: Text formatting?
1 participant