links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Recipe: How to quote a string when generating HTML?
Last updated at 6:20 pm UTC on 5 March 2017
In this recipe it is assumed that you want to write a method where a HTML template is assigned to a string variable.

To get the quoted HTML code do the following.

1. Open a Workspace.
2. Paste the HTML code into the workspace.


3. Bring up the Halos of the workspace


4. In the red halo menu choose 'debug' -> inspect model

5. Then click on 'explore' and 'dependents' and drill down until you find the 'text' instance variable.


6. Open an inspector on the text and click on 'string' in the Text inspector.

7. Close the window labeled 'a Workspace'. You now have a workspace labeled 'Workspace with HTML template string' where the text you edit is automatically converted to a quoted string in the window on the right hand side.

8. To get the quoted string click on 'string' in the Text inspector and choose 'inspect'. This gives you the string you may paste into your method.

Source: Bob Arning - Squeak Mailing List Sat, Feb 2, 2013 at 1:03 AM

See also PluggableTextMorphWithModel