-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add test cases for text box underline, strikethrough, and highlight features #311
Add test cases for text box underline, strikethrough, and highlight features #311
Conversation
lib/recipe/htmlToTextObjects.js
Outdated
@@ -82,19 +82,22 @@ function parseNode(node) { | |||
const parsedData = { | |||
value, | |||
tag: node.tagName, | |||
font: options ? options.font : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these options in the typescript definitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These options are not in the typescript definitions. They are similar to the objects that are returned from the function _makeTextObject in lib/receipt/text.js
Thank you very much for the pr |
cc40df0
to
d434591
Compare
please run prettier on the changed files, prettier is complaining about not compliant files. see: https://github.com/julianhille/MuhammaraJS/actions/runs/5426565804/jobs/9942641353?pr=311 thanks |
one item to note, when the option
is set, text wrapped in html tags seem to be created on a new line. i still need to look into this. should i address the fix in this pr? or create another one for it? |
i would suggest to start with it and then see. i'd use this as a base branch and then go from there, if its a small change related to this changes add it as commits, if its a complete seperate issue create a PR against this one. sounds reasonable? |
I changed base too see if this runs in fixed ci. Would you mind reading on that prepare V4 branch? |
i don't mind reading from that branch. i see it was deleted though. which branch should i direct this pr to? |
Ah. Dang. Sorry. Please reopen against dev. |
Test to reopen. |
I created a commit to address the text wrapped in html tags appearing on a new line. I've also added a test case for bolded text. There are some spacing issues to address now. after_Add text with underline inside textbox.pdf |
lib/recipe/text.js
Outdated
@@ -97,6 +97,7 @@ function _initOptions(self, x = {}, y, options = {}) { | |||
self._firstLineHeight = 0; // indicates not set yet, determined later. | |||
self._textOptions = { textBox: {} }; | |||
self._previousTextObjects = []; | |||
self._previousTextObjects2 = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be there a name which tells a bit more what this variables holds?
sorry this branch has conflicts in the changelog, please rebase / merge dev |
f8c0989
to
67329bd
Compare
rebased. will work on spacing and may modify the changes a bit more |
67329bd
to
264bb9a
Compare
I will move the changes for the bug fix into its own branch and just keep the tests on this one |
fc2a347
to
771aaf6
Compare
linting has issues |
I ran prettier on this diff, and it says that all files are using the prettier code style. Is there something else I have to do? I am using node v18.17 |
against what folder? Lint action says: tests/recipe/text.js is needs prettier run |
Ran it on the project's root folder |
did you compare versions of prettier? |
386c0f8
to
771aaf6
Compare
ok, that was the issue. it looks like prettier was upgraded to a new major version. one thing though, now that i run prettier, its modifying many more files |
I'd suggest to just run it on the one file. Will add a PR fixing all the issues. Otherwise I might have a huge conflict. |
ok, only ran it on the files that were modified on this pr |
last thing, i hope, would you mind adding a changelog entry or do you want me to?
|
i added them under unreleased 😄 |
im sorry just overlooked it. nevermind. ci run incoming.... |
🥳 finally a lint run :P |
One last thing. Please squash merge fixup some of the last commits and how you'd think it's good readable. |
d216ae7
to
a703058
Compare
Squashed |
a703058
to
ec20133
Compare
Had to make some modifications to lib/recipe/htmlToTextObjects.js and lib/recipe/text.js to make tests pass when
is set as an option when invoking .text()