Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  in the same way that one-sentence-per-line  
  gives you much more fine-grained diffs than  
  one-paragraph-per-line, notching it down to  
  one-phrase-per-line gives the best results.

  a simple javascript routine can do that split,  
  and then rejoin the lines after you do a diff.  

  i've written this up extensively, to no notice.  

  http://zenmagiclove.com/simple/breaker.html

  https://github.com/bbirdiman/breakerbreaker

  ***

  i've since found that a dozen changes suffice:

  replace ". "  -- with --  ". \n"
  replace ", "  -- with --  ", \n"
  replace "? "  -- with --  "? \n"
  replace "! "  -- with --  "! \n"
  replace ": "  -- with --  ": \n"
  replace "; "  -- with --  "; \n"
  replace ") "  -- with --  ") \n"
  replace "] "  -- with --  "] \n"
  replace "} "  -- with --  "} \n"
  replace "-- "  -- with --  "-- \n"
  replace "' "  -- with --  "' \n"
  
  replace '" '  -- with --  '" \n'

  ***

  and, of course, to revert those changes,
  you simply change " \n" to " " and boom.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: