Visitar URL original
In the Edge browser, the character `{docsify-updated}` is not replaced · Issue #2681 · docsifyjs/docsify · GitHub
Skip to content

In the Edge browser, the character {docsify-updated} is not replaced #2681

Description

@yequanrui

Description

https://yequanrui.github.io/CloudNotes/#/_index

It displays correctly in the Chrome browser, with {docsify-updated} being replaced by the value of last-modified.

Image

It is displayed incorrectly in the Edge browser. The last-modified has a value, but {docsify-updated} is not replaced.

Image

Expected behavior

Replace with the value of last-modified.

Actual behavior

{docsify-updated} has not been replaced.

Steps to reproduce

  1. Check whether the value after Last update time: is correct in the Chrome browser
  2. Check whether the value after Last update time: is correct in the Edge browser

Environment

  • Your OS: Windows 11 25H2
  • Node.js version: 20.20.0
  • npm/yarn version: 10.9.4
  • Browser version: Edge 145.0.3800.70 / Chrome 145.0.7632.110
  • Docsify version: 4.13.1
  • Docsify plugins (if the bug happens when plugins enabled, please try to isolate the issue): docsify-updated 1.0.5

Additional Information

  • Bug still occurs when all/other plugins are disabled?

Activity

  1. sy-records commented on Apr 15, 2026

    @sy-records
    Member

    I can't reproduce it

    Image
  2. added
    wait for informationsomething is not clear, waiting for the author of the issue/pr
    and removed
    bugconfirmed as a bug
    on Apr 15, 2026
  3. hiSandog commented on Jun 26, 2026

    @hiSandog

    One thing that would help narrow this down is whether Edge is loading the same generated HTML and the same last-modified response headers as Chrome after a hard refresh. Since the placeholder replacement depends on fetching/seeing that metadata, it would be useful to include the Edge version, whether any service worker/cache is involved, and a small network-panel screenshot for the markdown file request. That would separate a Docsify parsing issue from an Edge cache/header difference.

  4. yequanrui commented on Jun 29, 2026

    @yequanrui
    Author

    I found that in the Chrome browser, by adding a breakpoint to the line of code where the date is replaced, the breakpoint will take effect.
    Image
    However, in the Edge browser, the breakpoint did not take effect.
    Image

    One thing that would help narrow this down is whether Edge is loading the same generated HTML and the same last-modified response headers as Chrome after a hard refresh. Since the placeholder replacement depends on fetching/seeing that metadata, it would be useful to include the Edge version, whether any service worker/cache is involved, and a small network-panel screenshot for the markdown file request. That would separate a Docsify parsing issue from an Edge cache/header difference.

  5. AmanUllah687 commented on Aug 4, 2026

    @AmanUllah687

    I'd like to take this on. Traced it down to src/core/render/index.js:

    if (opt.updatedAt) {
      html = this.#formatUpdated(html, opt.updatedAt, this.config.formatUpdated);
    }

    opt.updatedAt comes from xhr.getResponseHeader('last-modified') in ajax.js. This is a truthy check — if that header comes back empty in Edge for this request, the whole replace step gets skipped silently, which matches what @yequanrui described (breakpoint on the replace line never fires in Edge).

    Going to verify with a Network-tab comparison between Chrome and Edge to confirm whether Last-Modified is actually present/absent in Edge's response headers before proposing a fix. Will follow up with findings.

  6. AmanUllah687 commented on Aug 4, 2026

    @AmanUllah687

    I'd like to take this on. Traced it down to src/core/render/index.js:

    if (opt.updatedAt) {
    html = this.#formatUpdated(html, opt.updatedAt, this.config.formatUpdated);
    }
    opt.updatedAt comes from xhr.getResponseHeader('last-modified') in ajax.js. This is a truthy check — if that header comes back empty in Edge for this request, the whole replace step gets skipped silently, which matches what @yequanrui described (breakpoint on the replace line never fires in Edge).

    Going to verify with a Network-tab comparison between Chrome and Edge to confirm whether Last-Modified is actually present/absent in Edge's response headers before proposing a fix. Will follow up with findings.

    Followed up on this — built a minimal repro against current develop (v5) using a local static server, tested in both Chrome and Edge with cache disabled to rule out stale responses. In both browsers, {docsify-updated} correctly resolves to a real date; I couldn't reproduce the Edge-specific failure described here.

    Since the original report was on Docsify 4.13.1, it's possible this was fixed during the v5 rewrite, or it's specific to how the CDN (GitHub Pages/Fastly) exposes response headers to Edge versus a plain local server — that's not something I can replicate locally. If it's still happening on current develop, more detail on the hosting setup would help narrow it down.

    Separately, while testing this I found a real, unrelated bug: the default formatUpdated: '' config causes {docsify-updated} to always render blank (via tinydate('') always returning an empty string), regardless of browser. Happy to open a small PR for that if useful — want me to file it as its own issue, or is a direct PR fine?

  7. sy-records commented on Aug 4, 2026

    @sy-records
    Member

    Separately, while testing this I found a real, unrelated bug: the default formatUpdated: '' config causes {docsify-updated} to always render blank (via tinydate('') always returning an empty string), regardless of browser. Happy to open a small PR for that if useful — want me to file it as its own issue, or is a direct PR fine?

    formatUpdated is empty by default; if you need to use it, you must set the format.

  8. AmanUllah687 commented on Aug 4, 2026

    @AmanUllah687

    Separately, while testing this I found a real, unrelated bug: the default formatUpdated: '' config causes {docsify-updated} to always render blank (via tinydate('') always returning an empty string), regardless of browser. Happy to open a small PR for that if useful — want me to file it as its own issue, or is a direct PR fine?

    formatUpdated is empty by default; if you need to use it, you must set the format.

    Ah, that makes sense — thanks for clarifying. Good to know it's intentional rather than a bug.

    Since the original Edge-specific issue also didn't reproduce on current develop in my testing, is it worth closing this one out, or would you prefer to leave it open in case someone can reproduce it with more specific hosting details?

  9. sy-records commented on Aug 4, 2026

    @sy-records
    Member

    Wait for the author; I can't reproduce this issue either. @yequanrui

  10. AmanUllah687 commented on Aug 4, 2026

    @AmanUllah687

    Sounds good, I'll leave this to @yequanrui to follow up with more detail.

  11. sy-records commented on Aug 4, 2026

    @sy-records
    Member

    This is another solution. #1157 (comment)

  12. AmanUllah687 commented on Aug 4, 2026

    @AmanUllah687

    Makes sense — given #1157 was closed as not planned for essentially the same root cause (header/timestamp behavior varying by host), this looks like a known limitation rather than something fixable in Docsify's code. I'll leave this closed on my end too. Thanks for digging up the history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wait for informationsomething is not clear, waiting for the author of the issue/pr

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions