Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

SugarCane wraps each passage text letter with span

I looked at the html generated when building a story using the SugarCane story format and noticed that each individual letter of a passages' text is wrapped within a <span> tag.

Is there a way to turn this feature off, because it builds an expensive DOM object.

eg. A Passage text of just "A quick brown fox jumbed over the lazy dog" results in
[pre]<div class="body content">
  <span class="char" data-char="T">T</span>
  <span class="char" data-char="h">h</span>
  <span class="char" data-char="e">e</span>
  <span class="char" data-char="space"> </span>
  <span class="char" data-char="q">q</span>
  ...... a lot more span tags.....
  <span class="char" data-char="g">g</span>
</div>
[/pre]

Comments

  • I get the same thing when I select text in a Twine, then right-click and "View selection source." However, if I view page source in a browser, or a text editor, everything appears normal. OSX 10.7.5, Firefox 26.0, Twine 1.4.1 and 1.4.2.
  • @Strangelander

    The reason for the difference in the two views of the source is because when you used "View selection source." you were looking at the HTML dynamically generated by the java-script engine embedded within the story file which uses the information stored within your passages to change what you see as required based on your interactions.

    The source you viewed using a text-editor is the code generated by the Twine/Twee application itself.
  • The reason this is the case is because it enables these CSS effects. It isn't that expensive.

    But, I suppose I could add in a thing that dynamically checks for the ".char" selector in the story stylesheets, and disables this feature if it's absent.
Sign In or Register to comment.