Skip to content

Commit

Permalink
Fix: abstract field loses markdown formatter after resetting default …
Browse files Browse the repository at this point in the history
…preview style (JabRef#10942)

* add abstract field to customizable preview style migrations

* update the default preview style

* Revert "add abstract field to customizable preview style migrations"

This reverts commit 6068cb4.

* markdown support for review
  • Loading branch information
LoayGhreeb authored Feb 29, 2024
1 parent 299715e commit 597828b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private static void migrateTypedKeyPrefs(JabRefPreferences prefs, Preferences ol
*/
protected static void upgradePreviewStyle(JabRefPreferences prefs) {
String currentPreviewStyle = prefs.get(JabRefPreferences.PREVIEW_STYLE);
String migratedStyle = currentPreviewStyle.replace("\\begin{review}<BR><BR><b>Review: </b> \\format[HTMLChars]{\\review} \\end{review}", "\\begin{comment}<BR><BR><b>Comment: </b> \\format[HTMLChars]{\\comment} \\end{comment}")
String migratedStyle = currentPreviewStyle.replace("\\begin{review}<BR><BR><b>Review: </b> \\format[HTMLChars]{\\review} \\end{review}", "\\begin{comment}<BR><BR><b>Comment: </b> \\format[Markdown,HTMLChars]{\\comment} \\end{comment}")
.replace("\\format[HTMLChars]{\\comment}", "\\format[Markdown,HTMLChars]{\\comment}")
.replace("<b><i>\\bibtextype</i><a name=\"\\bibtexkey\">\\begin{bibtexkey} (\\bibtexkey)</a>", "<b><i>\\bibtextype</i><a name=\"\\citationkey\">\\begin{citationkey} (\\citationkey)</a>")
.replace("\\end{bibtexkey}</b><br>__NEWLINE__", "\\end{citationkey}</b><br>__NEWLINE__");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/model/entry/field/StandardField.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
public enum StandardField implements Field {

ABSTRACT("abstract", FieldProperty.MULTILINE_TEXT, FieldProperty.MARKDOWN),
ABSTRACT("abstract", FieldProperty.MULTILINE_TEXT),
ADDENDUM("addendum"),
ADDRESS("address"),
AFTERWORD("afterword", FieldProperty.PERSON_NAMES),
Expand Down Expand Up @@ -104,7 +104,7 @@ public enum StandardField implements Field {
PRIMARYCLASS("primaryclass"),
RELATED("related", FieldProperty.MULTIPLE_ENTRY_LINK),
REPORTNO("reportno"),
REVIEW("review", FieldProperty.MULTILINE_TEXT, FieldProperty.VERBATIM),
REVIEW("review", FieldProperty.MULTILINE_TEXT, FieldProperty.VERBATIM, FieldProperty.MARKDOWN),
REVISION("revision"),
SCHOOL("school"),
SERIES("series"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ private JabRefPreferences() {
"\\begin{pages}<BR> p. \\format[FormatPagesForHTML]{\\pages}\\end{pages}__NEWLINE__" +
"\\begin{abstract}<BR><BR><b>Abstract: </b>\\format[HTMLChars]{\\abstract} \\end{abstract}__NEWLINE__" +
"\\begin{owncitation}<BR><BR><b>Own citation: </b>\\format[HTMLChars]{\\owncitation} \\end{owncitation}__NEWLINE__" +
"\\begin{comment}<BR><BR><b>Comment: </b>\\format[HTMLChars]{\\comment}\\end{comment}__NEWLINE__" +
"\\begin{comment}<BR><BR><b>Comment: </b>\\format[Markdown,HTMLChars]{\\comment}\\end{comment}__NEWLINE__" +
"</font>__NEWLINE__");

// set default theme
Expand Down

0 comments on commit 597828b

Please sign in to comment.