Qownnotes: Markdown to PDF - HTML attributes shown twice

Created on 1 Nov 2020  路  14Comments  路  Source: pbek/QOwnNotes

Expected behaviour

Have correctly generated HTML snippets when generating a PDF version of a note.

Actual behaviour

HTML second attribute is put twice in the output.

Steps to reproduce

  • Add an HTML snippet with an element that has two attributes.
  • Generate a PDF from the note.

Example:
In the Markdown note:
2020-11-01-1604226832_screenshot_750x178

The resulting PDF content
2020-11-01-1604226899_screenshot_986x134

Text version:

<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Wrap it once with:


And once with:



Workaround

Use another snippet typing, like JS, it will not have correct highlighting, but at least the PDF generated snippet has valid HTML as an example.

Output from the debug section in the settings dialog

Expand

QOwnNotes Debug Information

General Info

Current Date: So. Nov. 1 11:53:27 2020
Version: 20.10.11
Build date: Oct 28 2020
Build number: 778
Platform: linux
Operating System: Ubuntu Core 18
Build architecture: x86_64
Current architecture: x86_64
Release: Snapcraft
Qt Version (build): 5.9.5
Qt Version (runtime): 5.9.5
Portable mode: no
Settings path / key: /home/barry/snap/qownnotes/7643/.config/PBE/QOwnNotes.conf
Application database path: /home/barry/snap/qownnotes/7643/.local/share/PBE/QOwnNotes/QOwnNotes.sqlite
Application arguments: /snap/qownnotes/7643/usr/bin/QOwnNotes, -style=Breeze, --snap
Qt Debug: 0
Locale (system): en_US
Locale (interface): empty
Primary screen resolution: 1920x1080
Screen resolution(s): 1920x1080, 2560x1440
Icon theme: breeze-dark-qownnotes
Notes in current note folder: 32
Calendar items: 0
Enabled scripts: 0

Server Info

serverUrl: empty
appIsValid: no
notesPathExists: empty
connectionErrorMessage: empty

Spellchecking

Enabled: false
Selected language: empty
Language codes: empty
Language names: empty
Application dictionaries path: /home/barry/snap/qownnotes/7643/.local/share/PBE/QOwnNotes/dicts

Note folders

currentNoteFolderId: 1

Note folder default

id: 1
isCurrent: yes
activeTagId: 2
localPath: /home/barry/MEGAsync/notes
remotePath: Notes
cloudConnectionId: 1
isShowSubfolders: no
isUseGit: no
activeNoteSubFolder name: empty
database file: /home/barry/MEGAsync/notes/notes.sqlite

Cloud connections

Cloud connection ``

id: 1
isCurrent: yes
serverUrl: empty
username: empty

Enabled scripts

Settings

ActiveNoteHistoryItem (NoteHistoryItem): <binary data>
Debug/fakeOldVersionNumber (QString): false
Debug/fileLogging (QString): false
Editor/CurrentSchemaKey (QString): EditorColorSchema-cdbf28fc-1ddc-4d13-bb21-6a4043316a2f
Editor/autoBracketClosing (QString): true
Editor/autoBracketRemoval (QString): true
Editor/disableCursorBlinking (QString): false
Editor/editorWidthInDFMOnly (QString): true
Editor/highlightCurrentLine (QString): true
Editor/indentSize (QString): 4
Editor/removeTrainingSpaces (QString): false
Editor/useTabIndent (QString): false
Editor/vimMode (QString): false
FileDialog/LastPath (QString): /home/barry/Documents
FileDialog/LastPath-NotePDFExport (QString): /home/barry/Documents
IssueAssistantDialog/geometry (QByteArray): <binary data>
LastUpdateCheck (QDateTime): 2020-11-01T11:18:08
LocalTrashDialog/geometry (QByteArray): <binary data>
MainWindow/geometry (QByteArray): <binary data>
MainWindow/mainToolBar.iconSize (QString): 22
MainWindow/menuBarGeometry (QByteArray): <binary data>
MainWindow/noteTextEdit.code.font (QString): monospace,10,-1,2,50,0,0,0,0,0
MainWindow/noteTextEdit.font (QString): Sans,10,-1,5,50,0,0,0,0,0
MainWindow/noteTextView.code.font (QString): monospace,10,-1,2,50,0,0,0,0,0
MainWindow/noteTextView.font (QString): Sans,10,-1,5,50,0,0,0,0,0
MainWindow/noteTextView.ignoreCodeFontSize (QString): true
MainWindow/noteTextView.rtl (QString): false
MainWindow/noteTextView.underline (QString): true
MainWindow/noteTextView.useEditorStyles (QString): true
MainWindow/noteTextView.useInternalExportStyling (QString): true
MainWindow/showNotesFromAllNoteSubFolders (bool): true
MainWindow/tagTreeWidgetExpandState-1 (QStringList): 1
NoteFolder-1/NoteTabNameList (QStringList): HTML, Databases - Opdrachten
NoteFolder-1/NoteTabStickinessList (QStringList): empty
NoteFolder-1/NoteTabSubFolderPathDataList (QStringList): ,
NoteFolder-1/allowDifferentNoteFileName (bool): true
NoteHistory-1 (QVariantList): <variant list with 19 item(s)>
NoteHistoryCurrentIndex-1 (int): 18
PiwikClientId (QString): <hidden>
Printer/NotePDFExport (QByteArray): <binary data>
ScriptRepositoryDialog/mainSplitterState (QByteArray): <binary data>
SearchEngineId (QString): 2
SettingsDialog/geometry (QByteArray): <binary data>
SettingsDialog/mainSplitterState (QByteArray): <binary data>
ShowSystemTray (QString): false
StartHidden (QString): false
WelcomeDialog/geometry (QByteArray): <binary data>
acceptAllExternalModifications (QString): false
allowNoteEditing (bool): true
allowOnlyOneAppInstance (QString): true
appMetrics/disableAppHeartbeat (QString): false
appMetrics/disableTracking (QString): false
appMetrics/notificationShown (QString): true
automaticNoteFolderDatabaseClosing (QString): false
checkSpelling (bool): false
closeTodoListAfterSave (QString): false
cryptoKey (QString): <hidden>
currentNoteFolderId (QString): 1
currentWorkspace (QString): initial
cursorWidth (QString): 1
customNoteFileExtensionList: empty
darkMode (QString): true
darkModeColors (QString): true
darkModeIconTheme (QString): true
darkModeTrayIcon (QString): false
defaultNoteFileExtension (QString): md
disableAutomaticUpdateDialog (QString): true
disableSavedSearchesAutoCompletion (QString): false
dockWasInitializedOnce (QString): true
enableNoteTree (QString): false
enableSocketServer (QString): true
externalEditorPath (QString): empty
fullyHighlightedBlockquotes (QString): false
gitCommitInterval (QString): 30
gitExecutablePath (QString): empty
gitLogCommand (QString): empty
guiFirstRunInit (bool): true
ignoreAllExternalModifications (QString): false
ignoreAllExternalNoteFolderChanges (QString): false
ignoreNoteSubFolders (QString): ^\.
imageScaleDown (QString): false
imageScaleDownMaximumHeight (QString): 1024
imageScaleDownMaximumWidth (QString): 1024
initialLayoutIdentifier (QString): full
insertTimeFormat (QString): empty
interfaceFontSize (QString): 11
interfaceLanguage (QString): empty
internalIconTheme (QString): false
itemHeight (QString): 23
legacyLinking (QString): false
localTrash/autoCleanupDays (QString): 30
localTrash/autoCleanupEnabled (QString): true
localTrash/supportEnabled (QString): true
localTrashSplitterSizes (QByteArray): <binary data>
markdownHighlightingEnabled (QString): true
navigationPanelHideSearch (QString): false
networking/ignoreSSLErrors (QString): true
networking/proxyType (QString): 2
newNoteAskHeadline (QString): false
noteEditIsCentralWidget (QString): true
noteListPreview (QString): false
noteSaveIntervalTime (QString): 10
noteSubfoldersPanelDisplayAsFullTree (QString): true
noteSubfoldersPanelHideSearch (QString): false
noteSubfoldersPanelOrder (QString): 0
noteSubfoldersPanelShowFullPath (QString): false
noteSubfoldersPanelShowNotesRecursively (QString): false
noteSubfoldersPanelShowRootFolderName (QString): true
noteSubfoldersPanelSort (QString): 0
notesPanelOrder (QString): 0
notesPanelSort (QString): 1
notesPath (QString): /home/barry/MEGAsync/notes
notifyAllExternalModifications (QString): false
overrideInterfaceFontSize (QString): false
ownCloud/supportEnabled (QString): false
ownCloud/todoCalendarBackend (QString): 3
ownCloud/todoCalendarCalDAVPassword (QString): <hidden>
ownCloud/todoCalendarCalDAVServerUrl (QString): empty
ownCloud/todoCalendarCalDAVUsername (QString): empty
ownCloud/todoCalendarCloudConnectionId (QString): 0
ownCloud/todoCalendarDisplayNameList: empty
ownCloud/todoCalendarEnabledList: empty
ownCloud/todoCalendarEnabledUrlList: empty
ownCloud/todoCalendarUrlList: empty
ownCloudInfo/appIsValid (bool): false
ownCloudInfo/connectionErrorMessage (QString): empty
ownCloudInfo/notesPathExistsText (QString): empty
ownCloudInfo/serverVersion (QString): empty
restoreCursorPosition (QString): true
restoreLastNoteAtStartup (QString): true
restoreNoteTabs (QString): true
savedSearches/noteFolder-1 (QString): Note 2020-10-29T19.20.26
showMatches (QString): true
showMenuBar (bool): true
showStatusBar (bool): true
systemIconTheme (QString): false
taggingShowNotesRecursively (QString): false
tagsPanelHideNoteCount (QString): false
tagsPanelHideSearch (QString): false
tagsPanelOrder (QString): 0
tagsPanelSort (QString): 0
todoCalendarSupport (QString): true
toolbar/1/items (QStringList): action_New_note, action_Find_note, action_Remove_note, action_Open_note_in_external_editor, actionShow_local_trash, actionAllow_note_editing, , action_Back_in_note_history, action_Forward_in_note_history, , action_Find_text_in_note, actionReplace_in_current_note, , actionShow_versions, actionShow_trash, actionShare_note, , actionOpen_List
toolbar/1/name (QString): mainToolBar
toolbar/1/title (QString): main toolbar
toolbar/2/items (QStringList): actionFormat_text_bold, actionFormat_text_italic, actionStrike_out_text, actionInsert_code_block, actionInsert_block_quote
toolbar/2/name (QString): formattingToolbar
toolbar/2/title (QString): formatting toolbar
toolbar/3/items (QStringList): actionInsert_Link_to_note, actionInsert_image, actionInsert_current_time
toolbar/3/name (QString): insertingToolbar
toolbar/3/title (QString): inserting toolbar
toolbar/4/items (QStringList): action_Encrypt_note, actionEdit_encrypted_note, actionDecrypt_note
toolbar/4/name (QString): encryptionToolbar
toolbar/4/title (QString): encryption toolbar
toolbar/5/items (QStringList): actionWorkspaceComboBox, actionStore_as_new_workspace, actionRemove_current_workspace, actionRename_current_workspace, actionSwitch_to_previous_workspace, actionUnlock_panels, , actionToggle_distraction_free_mode, action_Increase_note_text_size, action_Decrease_note_text_size, action_Reset_note_text_size
toolbar/5/name (QString): windowToolbar
toolbar/5/title (QString): window toolbar
toolbar/6/items (QString): action_Quit
toolbar/6/name (QString): quitToolbar
toolbar/6/title (QString): quit toolbar
toolbar/size (QString): 6
useNoteFolderButtons (QString): false
useUNIXNewline (QString): false
webSocketServerService/bookmarksNoteName (QString): Bookmarks
webSocketServerService/bookmarksTag (QString): bookmarks
webSocketServerService/port (QString): 22222
workspace-initial/name (QString): Full
workspace-initial/noteSubFolderDockWidgetVisible (QString): true
workspace-initial/windowState (QByteArray): <binary data>
workspaces (QString): initial

System environment

__EGL_VENDOR_LIBRARY_DIRS: /snap/qownnotes/7643/etc/glvnd/egl_vendor.d:/snap/qownnotes/7643/usr/share/glvnd/egl_vendor.d
LIBGL_DRIVERS_PATH: /snap/qownnotes/7643/usr/lib/x86_64-linux-gnu/dri
LD_LIBRARY_PATH: /var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void:/snap/qownnotes/7643/lib/x86_64-linux-gnu:/snap/qownnotes/7643/usr/lib/x86_64-linux-gnu::/snap/qownnotes/7643/lib:/snap/qownnotes/7643/usr/lib:/snap/qownnotes/7643/lib/x86_64-linux-gnu:/snap/qownnotes/7643/usr/lib/x86_64-linux-gnu:/snap/qownnotes/7643/usr/lib/x86_64-linux-gnu/dri
FONTCONFIG_PATH: /snap/qownnotes/7643/etc/fonts
LC_MEASUREMENT: de_BE.UTF-8
XDG_CONFIG_HOME: /home/barry/snap/qownnotes/7643/.config
LC_PAPER: de_BE.UTF-8
LC_MONETARY: de_BE.UTF-8
LIBVA_DRIVERS_PATH: /snap/qownnotes/7643/usr/lib/x86_64-linux-gnu/dri
QTWEBENGINEPROCESS_PATH: /snap/qownnotes/7643/usr/lib/x86_64-linux-gnu/qt5/libexec/QtWebEngineProcess
PULSE_SERVER: unix:/run/user/1000/snap.qownnotes/../pulse/native
GST_PLUGIN_SYSTEM_PATH: /snap/qownnotes/7643/usr/lib/x86_64-linux-gnu/gstreamer-1.0
SNAP_USER_DATA: /home/barry/snap/qownnotes/7643
LANG: en_US.UTF-8
QT_PRINTER_MODULE: qtubuntu-print
DISPLAY: :0
OLDPWD: /home/barry
QTCHOOSER_NO_GLOBAL_DIR: 1
XKB_CONFIG_ROOT: /snap/qownnotes/7643/usr/share/X11/xkb
SNAP_REVISION: 7643
DISABLE_WAYLAND: 1
GST_PLUGIN_PATH: /snap/qownnotes/7643/usr/lib/x86_64-linux-gnu/gstreamer-1.0
SNAP_ARCH: amd64
SNAP_INSTANCE_KEY: empty
USERNAME: barry
XDG_VTNR: 2
QT_SELECT: snappy-qt5
SSH_AUTH_SOCK: /tmp/ssh-cgLps7WFG5xk/agent.2007
SNAP_REAL_HOME: /home/barry
LC_NAME: de_BE.UTF-8
XDG_SESSION_ID: 2
SNAP_USER_COMMON: /home/barry/snap/qownnotes/common
USER: barry
DESKTOP_SESSION: i3
QT_QPA_PLATFORMTHEME: gtk3
I3SOCK: /run/user/1000/i3/ipc-socket.2007
PWD: /home/barry
HOME: /home/barry/snap/qownnotes/7643
QTCOMPOSE: /snap/qownnotes/7643/usr/share/X11/locale
SNAP_LAUNCHER_ARCH_TRIPLET: x86_64-linux-gnu
SNAP: /snap/qownnotes/7643
SSH_AGENT_PID: 2067
QT_ACCESSIBILITY: 1
SNAP_COMMON: /var/snap/qownnotes/common
XDG_SESSION_TYPE: x11
SNAP_NAME: qownnotes
GTK_PATH: /snap/qownnotes/7643/usr/lib/x86_64-linux-gnu/gtk-2.0
XDG_DATA_DIRS: /home/barry/snap/qownnotes/7643/.local/share:/home/barry/snap/qownnotes/7643:/snap/qownnotes/7643/data-dir:/snap/qownnotes/7643/usr/share:/usr/share/i3:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
SNAP_INSTANCE_NAME: qownnotes
SNAP_DATA: /var/snap/qownnotes/7643
XDG_SESSION_DESKTOP: i3
LC_ADDRESS: de_BE.UTF-8
QML2_IMPORT_PATH: /snap/qownnotes/7643/lib/x86_64-linux-gnu:/snap/qownnotes/7643/usr/lib/x86_64-linux-gnu/qt5/qml
TMPDIR: /tmp
LC_NUMERIC: de_BE.UTF-8
GDK_PIXBUF_MODULE_FILE: /home/barry/snap/qownnotes/common/.cache/gdk-pixbuf-loaders.cache
GTK_MODULES: gail:atk-bridge
LOCPATH: /snap/qownnotes/7643/usr/lib/locale
SNAP_COOKIE: X_nvZOLe9z9YH0fR8hmAwt65GjukcOHPTNj7w5o-J1anKigx-FIF
WINDOWPATH: 2
QT_PLUGIN_PATH: /snap/qownnotes/7643/usr/lib/x86_64-linux-gnu/qt5/plugins
SHELL: /usr/bin/zsh
XDG_SESSION_CLASS: user
FONTCONFIG_FILE: /snap/qownnotes/7643/etc/fonts/fonts.conf
TEMPDIR: /tmp
XDG_CURRENT_DESKTOP: i3
XLOCALEDIR: /snap/qownnotes/7643/usr/share/X11/locale
GPG_AGENT_INFO: /run/user/1000/gnupg/S.gpg-agent:0:1
SNAP_REEXEC: empty
SHLVL: 1
XDG_SEAT: seat0
GST_PLUGIN_SCANNER: /snap/qownnotes/7643/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner
GDK_PIXBUF_MODULEDIR: /snap/qownnotes/7643/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders
LC_TELEPHONE: de_BE.UTF-8
QT_QPA_PLATFORM: xcb
GDMSESSION: i3
XDG_CACHE_HOME: /home/barry/snap/qownnotes/common/.cache
LOGNAME: barry
DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR: /run/user/1000/snap.qownnotes
XAUTHORITY: /run/user/1000/gdm/Xauthority
XDG_DATA_HOME: /home/barry/snap/qownnotes/7643/.local/share
SNAP_CONTEXT: X_nvZOLe9z9YH0fR8hmAwt65GjukcOHPTNj7w5o-J1anKigx-FIF
XDG_CONFIG_DIRS: /snap/qownnotes/7643/etc/xdg:/etc/xdg/xdg-i3:/etc/xdg
PATH: /snap/qownnotes/7643/usr/sbin:/snap/qownnotes/7643/usr/bin:/snap/qownnotes/7643/sbin:/snap/qownnotes/7643/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
LC_IDENTIFICATION: de_BE.UTF-8
SNAP_VERSION: 20.10.11
GIO_MODULE_DIR: /home/barry/snap/qownnotes/common/.cache/gio-modules
SNAP_LIBRARY_PATH: /var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void
XCURSOR_PATH: /snap/qownnotes/7643/data-dir/icons:/snap/qownnotes/7643/usr/share/icons
LC_TIME: de_BE.UTF-8

Low Bug

Most helpful comment

I'm looking into it. :< it's probably the regex string that doesn't include 0-9

All 14 comments

Can you please post the output from the debug settings (see issue template).
And is there any useful log output if you enable the log panel (see Window / Panels)? Please make sure you also enable debug logging in the log panel (by right-clicking on the panel and and selecting Debug in Options).

And please post a text version of your screenshot to try out.

@Waqar144, is that anything known?

@pbek Added the info. No relevant logging.

Thank you.

@Waqar144, I can confirm the problem in the preview. 馃槈

Here is the markdown to test:

```html
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
```

```js
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
```

20.11.2

  • a preview code block highlighting issue was fixed (for #1933, thank you @fnkabit)

There now is a new release, could you please test it and report if it works for you?

Issue fixed. I'll close this.

Great, thank you for testing!

I have to reopen. I just notice that after the fix, h1 h2 h3 h4 h5 h6 .. is not rendering correctly anymore.

In Markdown:

```html
<h1>Hoofding 1</h1>
<h2>Hoofding 2</h2>
<h3>Hoofding 3</h3>
<h4>Hoofding 4</h4>
<h5>Hoofding 5</h5>
<h6>Hoofding 6</h6>

In HTML:

<h>Hoofding 1</h>
<h>Hoofding 2</h>
<h>Hoofding 3</h>
<h>Hoofding 4</h>
<h>Hoofding 5</h>
<h>Hoofding 6</h>

I'm looking into it. :< it's probably the regex string that doesn't include 0-9

20.11.5

  • the html heading code highlighting was fixed (for #1933, thank you @fnkabit)

There now is a new release, could you please test it and report if it works for you?

The regex change did fix it.

Thanks, I'll close it again!

Great, thank you for testing!

Was this page helpful?
0 / 5 - 0 ratings