paleobot / pbot-dev

Codebase and initial design documents for pbot client
MIT License
2 stars 2 forks source link

General Issue: Special characters not allowed--try for HackAThon, but not promised #113

Closed clairecleveland closed 1 year ago

clairecleveland commented 1 year ago

We would like to allow special characters as many of our international users would like to use them and things like "" are important in comments. Currently we get this error: “Error: Invalid input 'H': expected whitespace, '.', node labels or rel types, '[', '^', '*', '/', '%', '+', '-', "=~", IN, STARTS, ENDS, CONTAINS, IS, '=', "<>", "!=", '<', '>', "<=", ">=", AND, XOR, OR, ',' or ']' (line 57, column 74 (offset: 2289)) " baseNode.caption <> "Fruits and Seeds Character "Hull" State "hairy" illustrated by Michael Rothman. Filename: PBot_FruitsAndSeeds_MichaelRothman_HairyChar_Rambutan_230208.jpg"," ^.

In addition, we need to consider if we want to allow italicized text and how that could be implemented. Not currently available. [ITALICS ISSUE IS NOT REQUESTED FOR HACKATHON]

NoisyFlowers commented 1 year ago

It would help to see the actual text string you are trying to input. Can you paste that here?

clairecleveland commented 1 year ago

Here is a list of character examples.

• ö é along with other internationally used accents on letters for user/author/location names etc. • “” ‘’ [] {} \ | ° • * ^ ? ! • italics is needed for species names and bold would be helpful • Would be good to be able to add subscript and superscript because they are used a lot in units such cm2 cm3 and also in labels such as lb and la for leaf base and apex and mathematical equations that are included in definitions

Dori and Ellen, is there anything I have forgotten here?

aazaff commented 1 year ago

Italics, bold, and other styling information (which is not the same as character set) would have to be treated as a separate issue. Regardless, I am against implementing it as it is a frequent source of data errors for both users and maintainers alike.

Some of the requested special characters are also potentially problematic, specifically "", '', [], {}, and \ which may conflict with html or other code elements -- but are likely doable. I defer to Doug on which ones can be done.

I will also note that this was stated to have been fixed as recently as last month #86 -- so I would like to know what has or has not changed.

NoisyFlowers commented 1 year ago

I just verified that the special characters listed are already accepted by PBot. Take a look at "repository" and "notes" in

http://128.196.196.17/query/specimen/e341cfee-29d2-490b-bc06-8cf56adefed5

(note for posterity: that specimen will soon be deleted)

Regarding things that require markup (italics, etc): Markup can be added to text right now (see "notes" in above link). We just interpret it as raw text when output. To interpret it as html, we would need to sanitize it in the browser first. This is possible but not trivial. I'd need to know what fields we want this functionality on. For anything fancier on data entry, we'd need to incorporate a rich text editor for appropriate fields. This too is possible.

Suggest closing this issue as Complete for the special characters and opening a low priority feature request for the markup that includes a list of exactly what fields we'd want it on.