From 40eba9e95e5b685bef06cb409c2577b410f45309 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 6 Mar 2020 18:57:46 +0000 Subject: [PATCH] All: Fixed top margin issue on note rendering --- .../lib/joplin-renderer/noteStyle.js | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/ReactNativeClient/lib/joplin-renderer/noteStyle.js b/ReactNativeClient/lib/joplin-renderer/noteStyle.js index e71b1e453..3d938c9ac 100644 --- a/ReactNativeClient/lib/joplin-renderer/noteStyle.js +++ b/ReactNativeClient/lib/joplin-renderer/noteStyle.js @@ -52,23 +52,20 @@ module.exports = function(style, options) { } /* Remove top padding and margin from first child so that top of rendered text is aligned to top of text editor text */ - /* Disabled, because it also applies to non-direct descendants of #rendered-md and also not a very elegant solution */ - - /* - #rendered-md h1:first-child, - #rendered-md h2:first-child, - #rendered-md h3:first-child, - #rendered-md h4:first-child, - #rendered-md ul:first-child, - #rendered-md ol:first-child, - #rendered-md table:first-child, - #rendered-md blockquote:first-child, - #rendered-md img:first-child, - #rendered-md p:first-child { + + #rendered-md > h1:first-child, + #rendered-md > h2:first-child, + #rendered-md > h3:first-child, + #rendered-md > h4:first-child, + #rendered-md > ul:first-child, + #rendered-md > ol:first-child, + #rendered-md > table:first-child, + #rendered-md > blockquote:first-child, + #rendered-md > img:first-child, + #rendered-md > p:first-child { margin-top: 0; padding-top: 0; } - */ p, h1, h2, h3, h4, h5, h6, ul, table { margin-top: .6em;