-
Notifications
You must be signed in to change notification settings - Fork 3
feat(PM-3318): Profile PDF implementation #47
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
68fe5f8
feat: download pdf design
hentrymartin 758704d
feat: download pdf design
hentrymartin 0359b02
feat: download pdf design
hentrymartin e77bd28
updated from develop
hentrymartin 331c2b2
feat: profile download pdf updates
hentrymartin 7097935
fix: minor bugs
hentrymartin d346920
fix: minor bugs
hentrymartin e7f8cf3
update from develop
hentrymartin e904fa9
update from develop
hentrymartin e6a9f09
debug logs
hentrymartin 6271d3d
debug logs
hentrymartin f826336
fix: special roles
hentrymartin fa5e6dd
fix: special roles
hentrymartin 9e5c3c4
fix: support rich text in badge name
hentrymartin 35b7619
fix: support rich text in badge name
hentrymartin 79aeb6e
fix: support rich text in badge name
hentrymartin 21ded30
fix: support rich text in badge name
hentrymartin f70581e
fix: support rich text in badge name
hentrymartin 3d05384
fix: support rich text in badge name
hentrymartin aecb4bd
fix: support rich text in badge name
hentrymartin c3c82d3
fix: support rich text in badge name
hentrymartin 5261556
updated identity service to point to develop
hentrymartin 18df364
updated from develop
hentrymartin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /** | ||
| * Convert HTML to plain text (strip tags, decode entities). | ||
| * Used for achievements/badge content in PDF so unregistered fonts (e.g. Roboto) are never passed to the renderer. | ||
| * @param {string} html - HTML string | ||
| * @returns {string} plain text | ||
| */ | ||
| function htmlToText (html) { | ||
| if (!html || typeof html !== 'string') return '' | ||
hentrymartin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| let out = html | ||
| // Strip all tags: replace with space so words don't glue together | ||
| .replace(/<[^>]*>/g, ' ') | ||
| // Collapse whitespace | ||
| .replace(/\s+/g, ' ') | ||
| .trim() | ||
|
|
||
| // Decode common HTML entities | ||
| out = out | ||
| .replace(/ /gi, ' ') | ||
| .replace(/</gi, '<') | ||
| .replace(/>/gi, '>') | ||
| .replace(/"/gi, '"') | ||
| .replace(/'/gi, "'") | ||
| .replace(/&/gi, '&') | ||
|
|
||
| return out | ||
| } | ||
|
|
||
| module.exports = { | ||
| htmlToText | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.