How can I convert the output of `git diff --color-words` to HTML?

扶醉桌前 提交于 2019-12-12 07:58:58

问题


For working with text that is prose, stored in plain text, I really like the output of git diff --color-words, but I don't like the way it is dependent on ANSI terminal escape sequences. I'd like to get output that I can use to turn into HTML, some kind of user-friendly raw character display, or to generate statistics on the differences between the two files.

I prefer Perl (including CPAN), but would settle for pretty much anything.


回答1:


This question asks about converting ANSI escape sequences into HTML color directives, and the accepted answer is a link to the Perl module HTML::FromANSI, in CPAN.



来源:https://stackoverflow.com/questions/1425738/how-can-i-convert-the-output-of-git-diff-color-words-to-html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!