GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — editor 里 lastDefaultMarkdownRef 的默认文案替换逻辑不生效 · Issue #392 · InvolutionHell/involutionhell

editor 里 lastDefaultMarkdownRef 的默认文案替换逻辑不生效 #392

New issue
Copy link
New issue
Copy link
Open
Open
editor 里 lastDefaultMarkdownRef 的默认文案替换逻辑不生效#392
Copy link

Description

@longsizhuo
longsizhuo
opened on Jul 26, 2026
Issue body actions

MarkdownEditor 中用 lastDefaultMarkdownRef 判断草稿是否仍是上次注入的默认示例,两个原因导致它永远为假:

useEditorStore 是无 persist 的模块单例,软导航后存活,而 lastDefaultMarkdownRef 是组件 ref,重挂载时复位为 null,比较对象丢失
crepe.getMarkdown() 是序列化回来的字符串,与 messages/*.json 里的原始 defaultMarkdown 大概率不逐字节相等(尾部换行、转义差异)

现在的实际行为等价于「store 为空时才注入默认示例」。

复现:进 /zh/editor 不输入任何内容,停留超过 2 秒,点返回首页,切 EN,再进 /en/editor,起始内容仍是中文。

处理方式二选一:删掉这套 ref 机制,让代码等于实际行为;或在 store 里加 hasEdited 标记,由输入事件置位,用标记代替字符串比较。

Activity

  1. longsizhuo commented on Jul 26, 2026

    @longsizhuo
    longsizhuo
    on Jul 26, 2026
    MemberAuthor
    More actions

    #388

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.