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

fix(annotate_citations): try to include HTML style tags if not balanced #197

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

grossir
Copy link
Contributor

@grossir grossir commented Jan 30, 2025

Some annotations, specially for ReferenceCitations, are discarded in HTML sources because some style tags (mostly i or em) are not balanced. This PR tries to include the style tags in the citation span

  • Adds tests for utils.maybe_balance_style_tags

Solves #196

@grossir grossir force-pushed the 196-include-html-style-tags-in-citation-span branch from 39142e5 to ef078f6 Compare January 30, 2025 01:17
Some annotations, specially for ReferenceCitations, are discarded in HTML sources because some style tags (mostly i or em) are not balanced. This PR tries to include the style tags in the citation span

- Adds tests for `utils.maybe_balance_style_tags`
- Add a logger.error call when the unbalanced HTML could not be fixed

Solves #196
@grossir grossir force-pushed the 196-include-html-style-tags-in-citation-span branch from ef078f6 to 4bfcc46 Compare January 30, 2025 01:18
@grossir
Copy link
Contributor Author

grossir commented Jan 30, 2025

Unrelated to this specific PR, but, how to run the lint jobs locally?
In other repos we just do pre-commit run --all-files
Here I ran from the main directory

black .
isort .

Shouldn't we have a .pre-commit config file?

Copy link
Contributor

The Eyecite Report 👁️

Gains and Losses

There were 0 gains and 0 losses.

Click here to see details.
id Gain Loss

Time Chart

image

Generated Files

Branch 1 Output
Branch 2 Output
Full Output CSV

@grossir
Copy link
Contributor Author

grossir commented Jan 30, 2025

@flooie this is ready for review in case you want to review it or assign it to someone else

Copy link
Contributor

@flooie flooie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice to have fixed. thanks @grossir

@flooie flooie merged commit 90718a5 into main Feb 3, 2025
13 checks passed
@flooie flooie deleted the 196-include-html-style-tags-in-citation-span branch February 3, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants