Code fragment rendering error
I entered some code fragment but it renders very strange (on the left is markdown editor, on the right is the actual result):

Expected behaviour
The actual result of this fragments rendering:
#words[s](bsd тред) |
#words[b](faceapp) |
#words[s](firefox тред) |
#words[s](macos тред) |
#words[b](tik-tok) |
Must be the same as the input. For example (in Visual Studio Code):

Actual behaviour
As shown above, the QOwnNotes renders this code fragment very strange and renders the PATH to QOwnNotes binary.
Steps to reproduce
Just add this code to your note.
Output from the debug section in the settings dialog
Expand
QOwnNotes Debug Information
General Info
Current Date: Mon Jan 31 17:18:18 2022
Version: 22.1.12
Build date: Jan 30 2022
Build number: 943
Platform: windows
Operating System: Windows 10 Version 2009
Build architecture: x86_64
Current architecture: x86_64
Release: GitHub Actions
Qt Version (build): 5.15.2
Qt Version (runtime): 5.15.2
Portable mode: yes
Settings path / key: C:/Users/Max/scoop/apps/qownnotes/current/Data/PBE/QOwnNotes.ini
Application database path: C:\Users\Max\scoop\apps\qownnotes\current\Data\QOwnNotes.sqlite
Application arguments: QOwnNotes.exe, --portable
Qt Debug: 0
Locale (system): en_US
Locale (interface): empty
Primary screen resolution: 1920x1080
Icon theme: breeze-dark-qownnotes
Notes in current note folder: 91
Calendar items: 0
Enabled scripts: 0
Server Info
serverUrl: empty
appIsValid: no
notesPathExists: empty
connectionErrorMessage: empty
Spellchecking
Enabled: true
Selected language: auto
Language codes: en_US, ru_RU
Language names: American English (United States), русский (Россия)
Application dictionaries path: C:\Users\Max\scoop\apps\qownnotes\current\Data\dicts
Cloud connections
Cloud connection Default
id: 1
isCurrent: yes
serverUrl: empty
username: empty
accountId: empty
Enabled scripts
Settings
AboutDialog/geometry (QByteArray): <binary data>
ActiveNoteHistoryItem (NoteHistoryItem): <binary data>
Debug/fakeOldVersionNumber (QString): false
Debug/fileLogging (QString): false
DictionaryManagerDialog/geometry (QByteArray): <binary data>
DictionaryManagerDialog/mainSplitterState (QByteArray): <binary data>
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/removeTrailingSpaces (QString): true
Editor/showLineNumbers (QString): true
Editor/useTabIndent (QString): false
Editor/vimMode (QString): false
FileDialog/LastPath (QString): C:/Users/Max/Desktop
FileDialog/LastPath-GitExecutable (QString): C:/Users/Max/scoop/apps/git/current/bin
FileDialog/LastPath-NotePDFExport (QString): C:/Users/Max/Desktop
ImageDialog/disableCopying (QString): false
ImageDialog/geometry (QByteArray): <binary data>
IssueAssistantDialog/geometry (QByteArray): <binary data>
JoplinImport/AttachmentImportCheckBoxChecked (QString): true
JoplinImport/FolderImportCheckBoxChecked (QString): false
JoplinImport/ImageImportCheckBoxChecked (QString): true
JoplinImport/MetadataImportCheckBoxChecked (QString): true
JoplinImport/TagImportCheckBoxChecked (QString): true
JoplinImportDialog/geometry (QByteArray): <binary data>
LastUpdateCheck (QDateTime): 2022-01-31T16:58:29.403
LinkDialog/geometry (QByteArray): <binary data>
LocalTrashDialog/geometry (QByteArray): <binary data>
MainWindow/geometry (QByteArray): <binary data>
MainWindow/mainToolBar.iconSize (QString): 24
MainWindow/menuBarGeometry (QByteArray): <binary data>
MainWindow/noteTextEdit.code.font (QString): Cascadia Mono,9,-1,5,50,0,0,0,0,0,Regular
MainWindow/noteTextEdit.font (QString): MS Shell Dlg 2,8,-1,5,50,0,0,0,0,0
MainWindow/noteTextView.code.font (QString): Courier New,9,-1,2,50,0,0,0,0,0
MainWindow/noteTextView.font (QString): MS Shell Dlg 2,7.875,-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): false
MessageBoxOverride/windows-dark-mode (QString): 16384
NoteDiffDialog/geometry (QByteArray): <binary data>
NoteHistory-1 (QVariantList): <variant list with 200 item(s)>
NoteHistoryCurrentIndex-1 (QString): 199
PasswordDialog/geometry (QByteArray): <binary data>
PiwikClientId (QString): <hidden>
Printer/NotePDFExportOrientation (int): 0
Printer/NotePDFExportPageSize (int): 4
ScriptRepositoryDialog/geometry (QByteArray): <binary data>
ScriptRepositoryDialog/mainSplitterState (QByteArray): <binary data>
SearchEngineId (QString): 2
SettingsDialog/geometry (QByteArray): <binary data>
SettingsDialog/mainSplitterState (QByteArray): <binary data>
ShareDialog/geometry (QByteArray): <binary data>
ShowSystemTray (QString): true
StartHidden (QString): false
TagAddDialog/geometry (QByteArray): <binary data>
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): true
closeTodoListAfterSave (QString): false
cryptoKey (QString): <hidden>
currentNoteFolderId (QString): 1
currentWorkspace (QString): initial
cursorWidth (QString): 1
darkMode (QString): true
darkModeColors (QString): true
darkModeIconTheme (QString): true
darkModeTrayIcon (QString): true
defaultNoteFileExtension (QString): md
demoNotesCreated (QString): true
disableAutomaticUpdateDialog (QString): true
disableSavedSearchesAutoCompletion (QString): false
dockWasInitializedOnce (QString): true
enableNoteTree (QString): false
enableSocketServer (QString): false
enableWebAppSupport (QString): false
externalEditorPath (QString): empty
fullyHighlightedBlockquotes (QString): true
gitCommitInterval (QString): 60
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): 15
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
noteFileExtensionList (QStringList): md, txt
noteListPreview (QString): false
noteSaveIntervalTime (QString): 10
noteSubfoldersPanelDisplayAsFullTree (QString): true
noteSubfoldersPanelHideSearch (QString): true
noteSubfoldersPanelOrder (QString): 1
noteSubfoldersPanelShowFullPath (QString): true
noteSubfoldersPanelShowNotesRecursively (QString): true
noteSubfoldersPanelShowRootFolderName (QString): false
noteSubfoldersPanelSort (QString): 0
notesPanelOrder (QString): 0
notesPanelSort (QString): 0
notesPath (QString): ../../../../../Cloud/Documents/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): 1
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
previousWorkspace (QString): a97b1872-dcb6-4879-9a95-f533a11b81e5
restoreCursorPosition (QString): true
restoreLastNoteAtStartup (QString): true
restoreNoteTabs (QString): true
showMatches (QString): true
showMenuBar (bool): true
showStatusBar (bool): true
spellCheckLanguage (QString): auto
systemIconTheme (QString): false
tagWasAddedToNote (QString): true
taggingShowNotesRecursively (QString): true
tagsPanelHideNoteCount (QString): false
tagsPanelHideSearch (QString): false
tagsPanelOrder (QString): 1
tagsPanelSort (QString): 0
todoCalendarSupport (QString): false
toolbar/1/items (QStringList): action_New_note, action_Find_note, action_Remove_note, action_Open_note_in_external_editor, actionAllow_note_editing, , action_Find_text_in_note, actionReplace_in_current_note
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_text_link, 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
webAppClientService/serverUrl (QString): wss://app.qownnotes.org
webAppClientService/token (QString): <hidden>
webSocketServerService/bookmarksNoteName (QString): Bookmarks
webSocketServerService/bookmarksTag (QString): bookmarks
webSocketServerService/commandSnippetsNoteName (QString): Commands
webSocketServerService/commandSnippetsTag (QString): commands
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
ALLUSERSPROFILE: C:\ProgramData
APPDATA: C:\Users\Max\AppData\Roaming
CommonProgramFiles: C:\Program Files\Common Files
CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
CommonProgramW6432: C:\Program Files\Common Files
COMPUTERNAME: DESKTOP-
ComSpec: C:\Windows\system32\cmd.exe
configsetroot: C:\Windows\ConfigSetRoot
DriverData: C:\Windows\System32\Drivers\DriverData
EMAIL: C:\Users\Max\Mail
FPS_BROWSER_APP_PROFILE_STRING: Internet Explorer
FPS_BROWSER_USER_PROFILE_STRING: Default
GIT_INSTALL_ROOT: C:\Users\Max\scoop\apps\git\current
HOMEDRIVE: C:
HOMEPATH: \Users\Max
LOCALAPPDATA: C:\Users\Max\AppData\Local
LOGONSERVER: \\DESKTOP-
OS: Windows_NT
Path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;;C:\Users\Max\AppData\Local\Microsoft\WindowsApps;C:\Users\Max\.dotnet\tools;C:\Users\Max\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Max\.dotnet\tools;C:\Users\Max\.dotnet\tools;C:\Users\Max\.dotnet\tools
PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
ProgramData: C:\ProgramData
ProgramFiles: C:\Program Files
ProgramFiles(x86): C:\Program Files (x86)
ProgramW6432: C:\Program Files
PROMPT: $P$G
PSModulePath: C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC: C:\Users\Public
SESSIONNAME: Console
SystemDrive: C:
SystemRoot: C:\Windows
TEMP: C:\Users\Max\AppData\Local\Temp
TMP: C:\Users\Max\AppData\Local\Temp
USERDOMAIN: DESKTOP-
USERDOMAIN_ROAMINGPROFILE: DESKTOP-
USERNAME: Max
USERPROFILE: C:\Users\Max
windir: C:\Windows
ZES_ENABLE_SYSMAN: 1
QML_DISABLE_DISK_CACHE: true
@Waqar144?
I can't reproduce that under Linux in portable mode with this note:
Code fragment
=============
```
#words[s] (bsd тред) |
#words[b] (faceapp) |
#words[s] (firefox тред) |
#words[s] (macos тред) |
#words[b] (tik-tok) |
```
@altwarg, does this also happen for you without portable mode?
@pbek, I've made some mistake. This issue appears when there is no space between [] and (), i.e.:
#words[s](bsd тред) |
#words[b](faceapp) |
#words[s](firefox тред) |
#words[s](macos тред) |
#words[b](tik-tok) |
I fixed my original post. And this issue appears without portable mode.
Seems like the markdown preprocessing we do makes them clickable URLs ...
ah, ok. you need no portable mode to reproduce this.
@Waqar144, it seems like ... you said it 😁
We need better heuristics to fix this, otherwise working around will only move the issue to some other edge case.
Maybe the highglighter should maintain some information about elements inside the document which other components can access. Stuff like
- headings in notes
- code blocks
- links
This issue is stale because it has been open for 30 days with no activity.
keep open. its a bug