diff -r 4ddc1020a154 -r ba7ea56fd672 src/org/sonews/storage/DrupalMessage.java --- a/src/org/sonews/storage/DrupalMessage.java Sun Nov 06 00:08:05 2011 +0100 +++ b/src/org/sonews/storage/DrupalMessage.java Mon Nov 07 17:47:10 2011 +0100 @@ -65,7 +65,7 @@ * * Also add header and body separate serialization. * - * And can be deserialized from SQL ResultSet + * And can be deserialized from SQL ResultSet or an Article * * @author František Kučera (frantovo.cz) */ @@ -75,13 +75,14 @@ * If body of message posted by user through NNTP starts with this text, * it will be treated as formated text in Markdown syntax. */ - private static final String MARKDOWN_HEADER = "#!markdown\r\n"; private static final Logger log = Logger.getLogger(DrupalMessage.class.getName()); private static final String MESSAGE_ID_HEADER = "Message-ID"; private static final String CRLF = "\r\n"; public static final String CHARSET = "UTF-8"; private static final String XHTML_CONTENT_TYPE = "text/html; charset=" + CHARSET; private static final String ZNAKČKA_KONCE_ŘÁDKU = "◆"; + private static final String MARKDOWN_HEADER = "#!markdown\r\n"; + private static final String SIGNATURE_BLOCK = "\r\n-- \r\n"; private String messageID; private Long parentID; private Long groupID; @@ -335,6 +336,7 @@ inputText = označKonceŘádků(inputText); Runtime r = Runtime.getRuntime(); + // TODO: spouštět přes sudo jako Markdown Process p = r.exec(new String[]{"tidy", // http://tidy.sourceforge.net "-asxml", // well formed XHTML "-numeric", // číselné entity @@ -530,7 +532,10 @@ */ public String getBodyXhtmlFragment() throws StorageBackendException { /** - * TODO: podporovat i zprávy přímo v HTML a multipart. + * TODO: + * - tohle dělat už v konstruktoru a pak už mít všechno stejné, ať už jde o zprávu přijatou od NNTP uživatele nebo načtenou z DB + * - podporovat i zprávy přímo v HTML a multipart. + * - ořezávat podpis (SIGNATURE_BLOCK) */ try { Object c = getContent();