You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/10/19 16:40:08 UTC

[GitHub] micheleriva edited a comment on issue #871: Copied & pasted string with newlines should show JSON syntax error in Ace editors

micheleriva edited a comment on issue #871: Copied & pasted string with newlines should show JSON syntax error in Ace editors
URL: https://github.com/apache/couchdb-fauxton/issues/871#issuecomment-431419662
 
 
   Hi @Antonio-Maranhao , I finally found out how to print a "pretty" error.
   
   ![ezgif com-video-to-gif](https://user-images.githubusercontent.com/14977595/47230858-a384a080-d3cb-11e8-8480-6e49e425060b.gif)
   
   After the "paste" event, I'm checking with a simple regex if there are any bad character for line start: `/^[^{|}|"|\s]/gm`.
   
   So, if any line does not begin with one of the following characters `{ } "` or a space, it will show a friendly message. 
   
   <img width="1676" alt="schermata 2018-10-19 alle 18 20 34" src="https://user-images.githubusercontent.com/14977595/47230926-cf078b00-d3cb-11e8-9411-f2268ae6233f.png">
   
   This will **only** work with "paste" events.
   
   Thanks!
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services