diggernet commented on PR #13:
URL: https://github.com/apache/velocity-tools/pull/13#issuecomment-1320649785

   While I totally agree with you in general about libraries ignoring RFC, I'm 
not sure I understand your frustration with regards to this change.  This has 
nothing to do with any RFC.  
   The purpose of this change is user discoverability.  When a user has a 
Velocity template that is a JSON file, and they need to escape the text they 
are putting into that JSON, what do they use?  Ah, there's $esc.javascript() 
and JSON comes from Javascript, so that should work.  It seems to work.  But 
then they hit a string with ' and suddenly it doesn't work.  Well, there's 
$esc.java(), but Java has nothing to do with JSON, so why trust that any more 
than $esc.javascript()?
   By adding $esc.json(), no matter the implementation, the user will see 
something obviously correct for their use case, and can move on to other 
things.  I happened to choose to use escapeJson() to implement it because that 
struck me as more correct, but Claude makes a good argument that the difference 
shouldn't matter.  Either way, the average Velocity user shouldn't need to care 
about those details.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org

Reply via email to