Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update docsify-updated to prevent replacement #1574

Merged
merged 5 commits into from
Jun 25, 2021

Conversation

sy-records
Copy link
Member

@sy-records sy-records commented May 18, 2021

Summary

Update docsify-updated to prevent replacement

before after
image image

What kind of change does this PR introduce?

docs

For any code change,

  • Related documentation has been updated if needed
  • Related tests have been updated or tests have been added

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

Related issue, if any:

#1573

Tested in the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

@vercel
Copy link

vercel bot commented May 18, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/docsify-core/docsify-preview/HZQpUy8cb42X2S2Pne4sAZj2dLLN
✅ Preview: https://docsify-preview-git-fork-sy-records-docsify-b1b15a-docsify-core.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 18, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b0b2d48:

Sandbox Source
docsify-template Configuration

Copy link
Member

@Koooooo-7 Koooooo-7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, it reminds me back to #1322. 😅

@Koooooo-7 Koooooo-7 requested a review from a team May 18, 2021 09:41
@sy-records
Copy link
Member Author

yeah, This file was previously loaded using a remote, but then rolled back...

@@ -108,4 +108,5 @@ Current version: <span id='tip-version'>loading</span>

<script>
document.getElementById('tip-version').innerText = Docsify.version
document.getElementsByClassName("lang-js")[2].innerHTML = document.getElementsByClassName("lang-js")[2].innerHTML.replace(/Last modified .*'/,"Last modified {docsify-updated<span>}'</span>")
Copy link
Member

@trusktr trusktr May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to reverse the breaking effect. Can we instead stop the breaking in the first place? It can be easier to understand that way, instead if adding "Band-Aids" that make it more difficult to understand what is happening.

Where is the break happening?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My "band aid" expression maybe sounded too harsh. It is a term my co-workers and I have used to describe quick fixes that don't solve the main issue, but add a workaround instead, making the code less ideal for the short term gain.

Do you know what is causing the issue in the first place?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it was replaced

function formatUpdated(html, updated, fn) {
updated =
typeof fn === 'function'
? fn(updated)
: typeof fn === 'string'
? tinydate(fn)(new Date(updated))
: updated;
return html.replace(/{docsify-updated}/g, updated);
}

@sy-records sy-records merged commit 2840ac5 into docsifyjs:develop Jun 25, 2021
@sy-records sy-records deleted the docsify-updated branch June 25, 2021 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants