Skip to content

Handling tags with empty values#63

Closed
holub008 wants to merge 2 commits intoMrTango:mainfrom
holub008:master
Closed

Handling tags with empty values#63
holub008 wants to merge 2 commits intoMrTango:mainfrom
holub008:master

Conversation

@holub008
Copy link
Copy Markdown
Contributor

Resolves: #62

Implementation: By making the space after a tag optional in the line PATTERN, content of '' will be extracted for the line, rather than failing to match the line pattern and concatenating the entire line to the current tag's content.

Testing: In addition to the test cases, I ran this change against my company's internal test suite for file import and saw no regression. Linter passes.

J535D165 added a commit to J535D165/rispy that referenced this pull request Aug 27, 2024
@shapiromatron shapiromatron self-assigned this Mar 26, 2025
Copy link
Copy Markdown
Collaborator

@shapiromatron shapiromatron left a comment

Choose a reason for hiding this comment

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

This looks great and seems like a valuation addition if Embase can sometimes strip that space from blank lines. It looks like the implementation for this will change when we merge in #66, but the tests have been migrated over to that PR (link) so that we know that this change will be included in that one too.

Nice work, may apologies for the molasses-speed review!

@holub008
Copy link
Copy Markdown
Contributor Author

Not a problem, thank you & glad the suggestion and test were useful!

@holub008 holub008 closed this Apr 11, 2025
shapiromatron pushed a commit that referenced this pull request May 22, 2025
* Revert strip UTF-8 BOM strip

* Improve performance and API of rispy parser

* Fix test

* Fix doctest

* Add test from PR #63

* Happy lint

* Remove BaseParser in favor of RisParser

There is no need for a Baseparser. This lib is on parsing RIS, so the RisParser should be leading.

* Deprecate get_tag and get_content in favor of parse_line

* Refactor, no changes

* Add test that tests multiple multiline formats

* Add support for more complex multiline RIS tags

* Happy lint

* Add changes as suggested by Peter

* Fix other issue discussed by Peter

* Add more challenges to multiline test

* Add type annotation

* Fix failing type annotation for Python 3.8
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.

Handling tags with empty values

2 participants