Skip to content

Instantly share code, notes, and snippets.

@bsima
Created January 29, 2015 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bsima/0ef4f0b4bdd3d5cad526 to your computer and use it in GitHub Desktop.
Save bsima/0ef4f0b4bdd3d5cad526 to your computer and use it in GitHub Desktop.
The sample text is here: https://gist.github.com/0474c33e403ab243019c
Undo justification: replace all newline characters with two spaces
regex: "\n\b"
subst: "\ \ "
Replace all paragraph markers with actual paragraphs
regex: "-P-"
subst: "\n\n"
Substitute two or more spaces with a single space
regex: "\ \ +"
subst: "\ "
@crdarter
Copy link

Thanks for sharing - what I'm noticing is the that while the text is no longer justified, the wrapping of the text is at time occurring mid-word. Is there a way to correct for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment