/*Runs HTMLTidy plugin for current buffer and removes empty lines*/ /*Macros.getMacro("TAAT/Smart_units").invoke(view); Macros.getMacro("TAAT/Smart_conjuctions").invoke(view); */ jtidy.TidyBuffer.tidyBuffer(view); // remove empty lines SearchAndReplace.setSearchString("\\n\\n"); SearchAndReplace.setReplaceString("\\n"); SearchAndReplace.setBeanShellReplace(false); SearchAndReplace.setIgnoreCase(true); SearchAndReplace.setRegexp(true); SearchAndReplace.setSearchFileSet(new CurrentBufferSet()); SearchAndReplace.replaceAll(view); // do not leave = at the end of line SearchAndReplace.setSearchString("\" ([^\\s]+)=\\n([^\\\"]+)\\\""); SearchAndReplace.setReplaceString("\"\\\"\\n \"+_2+_1+\"=\\\"\""); SearchAndReplace.setBeanShellReplace(true); SearchAndReplace.setIgnoreCase(true); SearchAndReplace.setRegexp(true); SearchAndReplace.setSearchFileSet(new CurrentBufferSet()); SearchAndReplace.replaceAll(view); // remove new lines after SearchAndReplace.setSearchString("\\n+"); SearchAndReplace.setReplaceString(""); SearchAndReplace.setBeanShellReplace(false); SearchAndReplace.setIgnoreCase(true); SearchAndReplace.setRegexp(true); SearchAndReplace.setSearchFileSet(new CurrentBufferSet()); SearchAndReplace.replaceAll(view); // DOCTYPE in one line SearchAndReplace.setSearchString("//EN\\\"\\n\\\"http"); SearchAndReplace.setReplaceString("/EN\\\" \\\"http"); SearchAndReplace.setBeanShellReplace(false); SearchAndReplace.setIgnoreCase(true); SearchAndReplace.setRegexp(true); SearchAndReplace.setSearchFileSet(new CurrentBufferSet()); SearchAndReplace.replaceAll(view); SearchAndReplace.setSearchString("?–?"); SearchAndReplace.setReplaceString(" –– "); SearchAndReplace.setBeanShellReplace(false); SearchAndReplace.setIgnoreCase(true); SearchAndReplace.setRegexp(false); SearchAndReplace.setSearchFileSet(new CurrentBufferSet()); SearchAndReplace.replaceAll(view);