KosmosisDire / obsidian-webpage-export

Export html from single files, canvas pages, or whole vaults. Direct access to the exported HTML files allows you to publish your digital garden anywhere. Focuses on flexibility, features, and style parity.
https://docs.obsidianweb.net/
MIT License
693 stars 58 forks source link

[Bug]: Wrong alignment of links in 'Table of Contents' #457

Closed psc1453 closed 2 weeks ago

psc1453 commented 2 weeks ago

What happened?

When the title contains Obsidian links like:

## [[link-to-another-place]]

In the exported HTML page, this title will be right-aligned rather than left-aligned as normal.

However, in Obsidian, it can be displayed correctly(left-aligned)

See the screenshot: 截屏2024-06-13 22 30 48

Reproduction

Just include links in titles like


# H1 [[link-1]]

## H2 [[link-2]]

### H3 [[link-3]]

Last Working Version

No response

Version

1.8.01

Operating System

macOS

Obsidian Version

1.5.12

Which browsers can you reproduce this in?

Firefox, Chrome, Safari, Microsoft Edge

Relevant log output

Log:
[INFO]  Including stylesheet: css-settings-manager
[WARNING]   Creating an RSS feed requires a site url to be set in the export settings.
[INFO]  Including stylesheet: css-settings-manager
[WARNING]   No existing export metadata found. All files will be exported.
[WARNING]   No existing search index found. All files will be exported.
[WARNING]   No existing RSS feed found. All files will be exported.
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "sherry" header as title because it was H1 at the top of the page
[INFO]  Using "酿造" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "yarra valley" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "产区" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "产区" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "cotes de provence aoc" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "产区" header as title because it was H1 at the top of the page
[INFO]  Using "酒标术语" header as title because it was H1 at the top of the page
[INFO]  Using "martinborough" header as title because it was H1 at the top of the page
[INFO]  Using "walker bay" header as title because it was H1 at the top of the page
[INFO]  Using "陈年术语" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "一类" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Closing render window
[WARNING]   Creating an RSS feed requires a site url to be set in the export settings.
[INFO]  Including stylesheet: css-settings-manager
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "酿造" header as title because it was H1 at the top of the page
[INFO]  No old files to delete
[INFO]  Closing render window
[WARNING]   Creating an RSS feed requires a site url to be set in the export settings.
[INFO]  Including stylesheet: css-settings-manager
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "酿造" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "参数" header as title because it was H1 at the top of the page
[INFO]  No old files to delete
[INFO]  Closing render window
[WARNING]   Creating an RSS feed requires a site url to be set in the export settings.
[INFO]  Including stylesheet: css-settings-manager
[WARNING]   No existing export metadata found. All files will be exported.
[WARNING]   No existing search index found. All files will be exported.
[WARNING]   No existing RSS feed found. All files will be exported.
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "sherry" header as title because it was H1 at the top of the page
[INFO]  Using "酿造" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "yarra valley" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "产区" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "产区" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "cotes de provence aoc" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "产区" header as title because it was H1 at the top of the page
[INFO]  Using "酒标术语" header as title because it was H1 at the top of the page
[INFO]  Using "martinborough" header as title because it was H1 at the top of the page
[INFO]  Using "walker bay" header as title because it was H1 at the top of the page
[INFO]  Using "陈年术语" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "一类" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "地理标志标签(gi)" header as title because it was H1 at the top of the page
[INFO]  Using "生长" header as title because it was H1 at the top of the page
[INFO]  Using "参数" header as title because it was H1 at the top of the page
[INFO]  Closing render window
[WARNING]   Creating an RSS feed requires a site url to be set in the export settings.
[INFO]  Including stylesheet: css-settings-manager
[INFO]  Using "yarra valley" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  No old files to delete
[INFO]  Closing render window
[WARNING]   Creating an RSS feed requires a site url to be set in the export settings.
[INFO]  Including stylesheet: css-settings-manager
[INFO]  Using "一类" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "地理标志标签(gi)" header as title because it was H1 at the top of the page
[INFO]  Using "生长" header as title because it was H1 at the top of the page
[INFO]  Using "参数" header as title because it was H1 at the top of the page
[INFO]  Using "通用" header as title because it was H1 at the top of the page
[INFO]  Closing render window
[WARNING]   Creating an RSS feed requires a site url to be set in the export settings.
[INFO]  Including stylesheet: css-settings-manager
[INFO]  Using "通用" header as title because it was H1 at the top of the page
[INFO]  No old files to delete
[INFO]  Closing render window
[WARNING]   Creating an RSS feed requires a site url to be set in the export settings.
[WARNING]   No existing export metadata found. All files will be exported.
[WARNING]   No existing search index found. All files will be exported.
[WARNING]   No existing RSS feed found. All files will be exported.
[INFO]  Using "一类" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "地理标志标签(gi)" header as title because it was H1 at the top of the page
[INFO]  Using "生长" header as title because it was H1 at the top of the page
[INFO]  Using "参数" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "特征" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "sherry" header as title because it was H1 at the top of the page
[INFO]  Using "酿造" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "yarra valley" header as title because it was H1 at the top of the page
[INFO]  Using "品种" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "产区" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "产区" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "cotes de provence aoc" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "产区" header as title because it was H1 at the top of the page
[INFO]  Using "酒标术语" header as title because it was H1 at the top of the page
[INFO]  Using "martinborough" header as title because it was H1 at the top of the page
[INFO]  Using "walker bay" header as title because it was H1 at the top of the page
[INFO]  Using "陈年术语" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "气候" header as title because it was H1 at the top of the page
[INFO]  Using "通用" header as title because it was H1 at the top of the page
[INFO]  Closing render window

Settings:
    settingsVersion --------- 1.8.01
    makeOfflineCompatible     false
    inlineAssets ------------ false
    includePluginCSS          1 plugins included
    includeSvelteCSS -------- true
    titleProperty             title
    customHeadContentPath ---
    faviconPath              
    documentWidth ----------- 40em
    sidebarWidth              20em
    minOutlineCollapse ------ 2
    startOutlineCollapsed     false
    allowFoldingHeadings ---- true
    allowFoldingLists         true
    allowResizingSidebars --- true
    logLevel                  warning
    minifyHTML -------------- true
    makeNamesWebStyle         true
    onlyExportModified ------ true
    deleteOldFiles            true
    addThemeToggle ---------- true
    addOutline                true
    addFileNav -------------- true
    addSearchBar              true
    addGraphView ------------ true
    addTitle                  true
    addRSSFeed -------------- true
    siteURL                  
    authorName --------------
    vaultTitle                Wine-Database
    exportPreset ------------ website
    openAfterExport           false
    graphAttractionForce ---- 1
    graphLinkLength           10
    graphRepulsionForce ----- 150
    graphCentralForce         3
    graphEdgePruning -------- 100
    graphMinNodeSize          3
    graphMaxNodeSize -------- 7
    showDefaultTreeIcons      false
    emojiStyle -------------- Native
    defaultFileIcon           lucide//file
    defaultFolderIcon ------- lucide//folder
    defaultMediaIcon          lucide//file-image
    exportPath -------------- /Users/psc/Downloads/Wine-debug
    filesToExport             1

Enabled Plugins:
    Discordian Theme
    Minimal Theme Settings
    Fuzzy Chinese Pinyin
    Webpage HTML Export

Additional Info

No response

psc1453 commented 2 weeks ago

In Obsidian, it shows correctly: 截屏2024-06-13 22 41 44

KosmosisDire commented 2 weeks ago

This was reported before and it is fixed in the beta version, you can download the beta or wait for the next stable release. Thanks!

psc1453 commented 2 weeks ago

I tried the beta version, it works pretty well! Thank you so much! Bought you a coffee~