0
因此,我有一個工具,用戶可以將用戶上傳SVN .patch
文件。與其單獨下載和查看它,我希望能夠通過紅色的綠色設計直接在線觀看。將.patch轉換爲HTML格式輸出,以便在線觀看
補丁文件[/uploads/Bug123.patch]
### Eclipse Workspace Patch 1.0
Index: src/main/java/com/admin/Screen.java
===================================================================
--- src/main/java/com/admin/Screen.java (revision 2)
+++ src/main/java/com/admin/Screen.java (working copy)
@@ -147,20 +147,22 @@
- System.out.println("Hello World");
+ System.out.println("Hello New World");
可視[/viewer.php?file=Bug123.patch]
<html><style>.red {background:lightcoral} .green {background:greenyellow} .yellow {background:yellow; font-weight:bold}</style><pre>
### Eclipse Workspace Patch 1.0
Index: src/main/java/com/admin/Screen.java
===================================================================
<span class="yellow">--- src/main/java/com/admin/Screen.java (revision 2)</span>
<span class="yellow">+++ src/main/java/com/admin/Screen.java (working copy)</span>
@@ -147,20 +147,22 @@
<span class="red">- System.out.println("Hello World"); </span>
<span class="green">+ System.out.println("Hello New World"); </span>
</pre></html>
你的問題是什麼? – scragar 2014-09-02 12:22:59
@scragar如何做到這一點?以補丁文件作爲輸入和輸出HTML – 2014-09-02 13:00:16