title: How to create custom escape strategy escaping only double quote (for json) in symfony & twig?
body: <p>A customer wants double quotes and only double quotes escaped for a json output.  This means single quotes should not be escaped as per the default twig html escape strategy, for example:</p>
  
  <pre><code>"2565": "Fête Médiéval du Royaume d&amp;#039;Osgoode "
  </code></pre>
  
  <p>The 'js' escape strategy does not fit the bill as it escapes all non-alphanumeric characters.  From Symfony/vendor/twig/twig/lib/Twig/Extension/Core.php</p>
  
  <pre><code>    case 'js':
          // escape all non-alphanumeric characters
          // into their \xHH or \uHHHH representations
  </code></pre>
  
  <p>I thought creating a custom escaping strategy would be the best way to go about it (perhaps  it wasn't, but that's not the end question of this post :-) ).  But how to create the custom strategy and more importantly, how to inject it in the twig environment via Symfony?</p>