Skip to content

Instantly share code, notes, and snippets.

@wharrell1271
Created August 8, 2011 18:39
Show Gist options
  • Save wharrell1271/1132391 to your computer and use it in GitHub Desktop.
Save wharrell1271/1132391 to your computer and use it in GitHub Desktop.
MHLL standoff markup primitive JS function
var i,l,
str = 'Mary had a little lamb, Its fleece was white as snow, And every where that Mary went The lamb was sure to go;',
poetryM = {'stanza':[[0,109]],'line':[[0,23],[24,53],[54,84],[85,109]]};
console.log('the poem is '+str.length+' characters long');
for(i=0,l=poetryM.line.length;i<l;i++){
console.log('line '+i+': '+str.slice(poetryM.line[i][0],poetryM.line[i][1]));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment