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

Curly bracket in annote field #10

ferdinandeibl opened this issue May 4, 2019 · 2 comments


Copy link

@ferdinandeibl ferdinandeibl commented May 4, 2019

Dear Adam,

As requested, I'm creating the issue regarding the problem of curly brackets occuring in annote fields which trigger the script to stop scanning. A further problem, which may be more difficult to resolve, is when there is line breaks and curly brackets in the annote field (which is my case).

Many thanks again for this amazing code.



This comment has been minimized.

Copy link

@adamjgnoel adamjgnoel commented May 5, 2019

Yes, an ending curly brace inside of an "annote" field will prematurely stop the scan to remove this field. A slightly better (but not foolproof) approach would be to search for "},\n", which is less likely to be confused elsewhere. The optimal solution would be to track the number of opened and closed curly braces, so that the scan is stopped once the closing curly brace that corresponds to the opening curly brace is detected (though this still isn't "perfect" because you might have added an extra closing curly brace somewhere).

@adamjgnoel adamjgnoel added the bug label May 5, 2019

This comment has been minimized.

Copy link

@adamjgnoel adamjgnoel commented Aug 26, 2019

I have updated the search for the end of an "annote" field to look for "},\n" instead of "},". This makes the search a bit more robust to custom text within the annotation field, but it will still remove the annotation incorrectly if there is "},\n" within the text of the annotation itself.

@adamjgnoel adamjgnoel closed this Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.