Issue #941: Only add <br/> tags to plain text extracted text fields. #942
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.
GitHub Issue: [BUG] islandora_text_extraction inserting
tags even when it shouldn't
What does this Pull Request do?
Checks the text format of an incoming extracted text field value, and only adds br tags if it is plain text.
What's new?
(i.e. Regeneration activity, etc.)? No
How should this be tested?
Set up a media such a a File that can take a TIFF being uploaded.
Add a field with type Text (Long) (not plain).
Create a custom action based on the text extraction action type. Pick the field you created just now, and select hOCR as the text format.
Add a context action so this action is fired when the media is uploaded.
Create a Page node and add a media of the type you created above. Upload a TIFF file with embedded text.
Observe that no extra br tags are inserted into the field when the action is fired after saving the media.
Documentation Status
Additional Notes:
Any additional information that you think would be helpful when reviewing this
PR.
Interested parties
Tag (@ mention) interested parties or, if unsure, @Islandora/committers
@ajstanley