}
public void editLatex(String guid) {
logger.log(logger.EXTREME, "Inserting latex");
String text = browser.selectedText();
if (text.trim().equalsIgnoreCase("\n") || text.trim().equalsIgnoreCase("")) {
InsertLatexImage dialog = new InsertLatexImage();
if (guid != null) {
String formula = conn.getNoteTable().noteResourceTable.getNoteSourceUrl(guid).replace("http://latex.codecogs.com/gif.latex?", "");
dialog.setFormula(formula);
}
dialog.exec();
if (!dialog.okPressed()) {
logger.log(logger.EXTREME, "Edit LaTex canceled");
return;
}
text = dialog.getFormula().trim();
}
blockApplication.emit(this);
logger.log(logger.EXTREME, "Inserting LaTeX formula:" +text);
latexGuid = guid;
text = StringUtils.replace(text, "'", "\\'");