diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index 6c62419..0f8ce08 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -179,6 +179,8 @@ typedef enum {
 	OP_NUM_MARK_MANTISSA,
 	OP_NUM_SIMPLIFY_MANTISSA,
 	OP_NUM_SIMPLIFY_EXPONENT,
+	OP_MARKUP_SUPERSCRIPT_START,
+	OP_MARKUP_SUPERSCRIPT_END,
 #endif
 	OP_NUM_FRACTION,	/* wholep explicitp (digits|denominator) */
 	OP_NUM_FRACTION_WHOLE,
@@ -1769,11 +1771,7 @@ go_format_parse_number_E (GOFormatParseState *pstate)
 			ADD_OP (OP_NUM_SIMPLIFY_MANTISSA);
 		ADD_OP2 (OP_CHAR, '1');
 		ADD_OP2 (OP_CHAR, '0');
-		ADD_OP2 (OP_CHAR, '<');
-		ADD_OP2 (OP_CHAR, 's');
-		ADD_OP2 (OP_CHAR, 'u');
-		ADD_OP2 (OP_CHAR, 'p');
-		ADD_OP2 (OP_CHAR, '>');
+		ADD_OP  (OP_MARKUP_SUPERSCRIPT_START);
 	} else
 #endif
 		ADD_OP2 (OP_CHAR, 'E');
@@ -1785,14 +1783,9 @@ go_format_parse_number_E (GOFormatParseState *pstate)
 
 #ifdef ALLOW_EE_MARKUP
 	if (use_markup) {
-		ADD_OP2 (OP_CHAR, '<');
-		ADD_OP2 (OP_CHAR, '/');
-		ADD_OP2 (OP_CHAR, 's');
-		ADD_OP2 (OP_CHAR, 'u');
-		ADD_OP2 (OP_CHAR, 'p');
-		ADD_OP2 (OP_CHAR, '>');
 		if (simplify_mantissa)
 			ADD_OP (OP_NUM_SIMPLIFY_EXPONENT);
+		ADD_OP  (OP_MARKUP_SUPERSCRIPT_END);
 	}
 #endif
 
@@ -2315,6 +2308,8 @@ go_format_dump_program (const guchar *prg)
 		REGULAR(OP_NUM_MARK_MANTISSA);
 		REGULAR(OP_NUM_SIMPLIFY_MANTISSA);
 		REGULAR(OP_NUM_SIMPLIFY_EXPONENT);
+		REGULAR(OP_MARKUP_SUPERSCRIPT_START);
+		REGULAR(OP_MARKUP_SUPERSCRIPT_END);
 #endif
 		REGULAR(OP_NUM_FRACTION_WHOLE);
 		REGULAR(OP_NUM_FRACTION_NOMINATOR);
@@ -2497,11 +2492,16 @@ SUFFIX(go_format_execute) (PangoLayout *layout, GString *dst,
 		DOUBLE w, n, d;
 		gsize nominator_start, denominator_start;
 	} fraction;
+	char *oldlocale = NULL;
 #ifdef ALLOW_EE_MARKUP
 	int mantissa_start = -1;
 	int special_mantissa = INT_MAX;
+	PangoAttrList *attrs = NULL;
+	GSList *markup_stack = NULL;
+
+	if (layout)
+		attrs = pango_attr_list_copy (pango_layout_get_attributes (layout));
 #endif
-	char *oldlocale = NULL;
 
 	memset (&fraction, 0, sizeof (fraction));
 
@@ -2510,8 +2510,15 @@ SUFFIX(go_format_execute) (PangoLayout *layout, GString *dst,
 
 		switch (op) {
 		case OP_END:
-			if (layout)
+			if (layout) {
 				pango_layout_set_text (layout, dst->str, -1);
+#ifdef ALLOW_EE_MARKUP
+
+				pango_layout_set_attributes (layout, attrs);
+				pango_attr_list_unref (attrs);
+				g_slist_free (markup_stack);
+#endif
+			}
 			if (numtxt)
 				g_string_free (numtxt, TRUE);
 			if (oldlocale) {
@@ -3062,6 +3069,33 @@ SUFFIX(go_format_execute) (PangoLayout *layout, GString *dst,
 				g_string_append_c (dst, '0');
 			}
 			break;
+
+		case OP_MARKUP_SUPERSCRIPT_START:
+			if (layout)
+				markup_stack = g_slist_prepend 
+					(markup_stack, GSIZE_TO_POINTER (dst->len));
+			break;
+
+		case OP_MARKUP_SUPERSCRIPT_END: 
+			if (layout) {
+				guint start = PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING, 
+					end = (guint)dst->len;
+				PangoAttribute *attr;
+				if (markup_stack) {
+					start = (guint)GPOINTER_TO_SIZE (markup_stack->data);
+					markup_stack = g_slist_delete_link (markup_stack, markup_stack);
+				}
+				 /* FIXME: we need to calculate the right rise value */
+				attr = pango_attr_rise_new (8 * PANGO_SCALE);
+				attr->start_index = start;
+				attr->end_index = end;
+				pango_attr_list_insert (attrs, attr);
+				attr = pango_attr_scale_new (PANGO_SCALE_X_SMALL);
+				attr->start_index = start;
+				attr->end_index = end;
+				pango_attr_list_insert (attrs, attr);
+			}
+			break;
 #endif
 
 		case OP_NUM_FRACTION: {
