diff --git a/resources/elcode_english.html b/resources/elcode_english.html
index 7707c63e..3daf8c00 100755
--- a/resources/elcode_english.html
+++ b/resources/elcode_english.html
@@ -75,6 +75,12 @@ The size of the text in pixels ranges from 1 to 29. Here are some examples:
| [center]Hello[/center] | will put the text in the center |
+
+[h1]Hello[/h1]
+[h2]Hello[/h2]
+[h3]Hello[/h3]
+ | will become a heading of level 1, level 2 or level 3 |
+
Tags can be nested, such as
diff --git a/scripts/elcode.js b/scripts/elcode.js
index ef1dd6a1..d8f704b3 100755
--- a/scripts/elcode.js
+++ b/scripts/elcode.js
@@ -90,3 +90,11 @@ function queryURL(text)
linkURL = prompt(linkURL_prompt, 'http://');
elcode1(text, 'URL', linkURL, linkText);
}
+
+function queryHeading(text)
+{
+ selection = getSelection(text);
+ heading = prompt(linkHeading_prompt, '');
+ tag = 'H' + heading;
+ elcode1(text, tag, '', selection);
+}
diff --git a/src/elogd.c b/src/elogd.c
index 5a676668..1da8d1b8 100755
--- a/src/elogd.c
+++ b/src/elogd.c
@@ -5532,6 +5532,14 @@ PATTERN_LIST pattern_list[] = {
{"[/list]", ""},
{"[list=", "
"},
+ /* headings */
+ {"[h1]", ""},
+ {"[/h1]", "
"},
+ {"[h2]", ""},
+ {"[/h2]", "
"},
+ {"[h3]", ""},
+ {"[/h3]", "
"},
+
/* URLs */
{"[url=", "%s"},
{"[url]", "%s"},
@@ -8740,6 +8748,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
/* strings for elcode.js */
rsprintf("linkText_prompt = '%s';\n", loc("Enter name of hyperlink"));
rsprintf("linkURL_prompt = '%s';\n", loc("Enter URL of hyperlink"));
+ rsprintf("linkHeading_prompt = '%s';\n", loc("Enter heading level (1, 2 or 3)"));
if (stristr(browser, "MSIE") && !stristr(browser, "opera"))
rsprintf("browser = 'MSIE';\n");
else if (stristr(browser, "Mozilla") && !stristr(browser, "opera") && !stristr(browser, "konqueror"))
@@ -9308,6 +9317,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
rsprintf(" ");
ricon("quote", loc("insert quote"), "elcode(document.form1.Text, 'QUOTE','')");
ricon("list", loc("insert list"), "elcode(document.form1.Text, 'LIST','')");
+ ricon("heading", loc("insert heading"), "queryHeading(document.form1.Text)");
rsprintf(" ");
ricon("code", loc("insert code"), "elcode(document.form1.Text, 'CODE','')");