From 806d8f06d75f4f8cd1e17e2263c57e7cf3784347 Mon Sep 17 00:00:00 2001 From: Eric Schrijver Date: Mon, 11 Nov 2013 22:59:30 +0100 Subject: [PATCH] Do we need the inline styles? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When using Etherpad as a content editor for blogs et al., programmatically exporting the HTML, the inline styles are a bit of a nuisance as they override existing CSS. As it stands, I do not really see the need for the inline styles—when using Etherpad’s HTML export as is, the browser will fall back to the standard header styles, which are pretty similar to what is defined here. --- ep_headings/index.js | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/ep_headings/index.js b/ep_headings/index.js index 2cc9cd1..5317884 100644 --- a/ep_headings/index.js +++ b/ep_headings/index.js @@ -5,38 +5,11 @@ exports.eejsBlock_editbarMenuLeft = function (hook_name, args, cb) { return cb(); } -function getInlineStyle(header) { - switch (header) { - case "h1": - return "font-size: 2.0em;line-height: 120%;"; - break; - case "h2": - return "font-size: 1.5em;line-height: 120%;"; - break; - case "h3": - return "font-size: 1.17em;line-height: 120%;"; - break; - case "h4": - return "line-height: 120%;"; - break; - case "h5": - return "font-size: 0.83em;line-height: 120%;"; - break; - case "h6": - return "font-size: 0.75em;line-height: 120%;"; - break; - case "code": - return "font-family: monospace"; - } - - return ""; -} // line, apool,attribLine,text exports.getLineHTMLForExport = function (hook, context) { var header = _analyzeLine(context.attribLine, context.apool); if (header) { - var inlineStyle = getInlineStyle(header); - return "<" + header + " style=\"" + inlineStyle + "\">" + context.text.substring(1) + ""; + return "<" + header + ">" + context.text.substring(1) + ""; } }