Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: search ignore diacritical marks#1434

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sy-records merged 9 commits intodocsifyjs:developfromsy-records:feat/1405
Feb 5, 2021

Conversation

@sy-records
Copy link
Member

Summary

search ignore diacritical marks

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Repo settings
  • Other, please describe:

If changing the UI of default theme, please provide thebefore/after screenshot:

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

  • Yes
  • No

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

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g.fix #xxx[,#xxx], where "xxx" is the issue number)

resolve#1405

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding anew feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open afeature request issue first and wait for approval before working on it.

@vercel
Copy link

vercelbot commentedNov 30, 2020
edited
Loading

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/fvsz0mwtj
✅ Preview:https://docsify-preview-git-fork-sy-records-feat-1405.docsify-core.now.sh

@codesandbox-ci
Copy link

codesandbox-cibot commentedNov 30, 2020
edited
Loading

This pull request is automatically built and testable inCodeSandbox.

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

Latest deployment of this branch, based on commit9668613:

SandboxSource
docsify-templateConfiguration

@sy-recordssy-records marked this pull request as draftNovember 30, 2020 09:26
@sy-records
Copy link
MemberAuthor

sy-records commentedNov 30, 2020
edited
Loading

Unfortunately, normalize does not support IE.

Microsoft is also about to discontinue support for IE 11, do we still need to be IE compatible? cc @docsifyjs/reviewers

@jhildenbiddle
Copy link
Member

jhildenbiddle commentedDec 1, 2020
edited
Loading

@sy-records --

Given the near-universal support ofnormalize in other browsers, I think we can just mention the need for aponyfill polyfill to support IE11 and provide a URL (below):

We should verify that thisponyfill polyfill does in fact work, and specify that it needs to be includedbefore any docsify-related<script> elements.

sy-records and Koooooo-7 reacted with thumbs up emoji

@sy-records
Copy link
MemberAuthor

I don't have IE11 to testing 😥

If we use this, do we want all users who need to search to add thispolyfill?

@jhildenbiddle
Copy link
Member

jhildenbiddle commentedDec 2, 2020
edited
Loading

I can test in IE11 once the PR is ready.

As for theponyfill polyfill, it should be optional. Docsify should feature check fornormalize support and use it if available. If not, then the search plugin should function as it always has. The docs should suggest theponyfill polyfill only for those concerned with diacritical marks and IE11 support. This way it's a non- breaking enhancement.

sy-records reacted with thumbs up emoji

@sy-recordssy-records marked this pull request as draftDecember 2, 2020 07:42
@sy-records
Copy link
MemberAuthor

@jhildenbiddle done

Copy link
Member

@jhildenbiddlejhildenbiddle left a comment
edited
Loading

Choose a reason for hiding this comment

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

Apologies for the slow response on this,@sy-records.

Verified working in modern browsers. Also verified working with and without polyfill in IE11. Great!

I did notice a few issues:

  1. Search results are not displayed with their original diacritical marks. Notice in the screenshot below that the page contains the string "Let's go to café today". A search for "cafe" (no diacritical marks) matches "café" as it should, but the search result displayed under the search field shows the normalized version ("cafe") instead of the original text ("café").

    Screen Shot 2020-12-15 at 1 42 11 AM
  2. Notice in the screenshot below that searching for "let" displays the matching search result text as "...Let's go to a cafe t...", but searching for "cafe" displays "...#39;s go to a cafe t...". That "#39;" looks like an incorrectly rendered HTML entity, but I haven't looked at the code to verify.

    Screen Shot 2020-12-15 at 1 51 33 AMScreen Shot 2020-12-15 at 1 51 15 AM
  3. It looks like apostrophes break the search result highlighting.

    Screen Shot 2020-12-15 at 1 52 36 AM

FYI: Docsify is currently broken in IE11 due to issues with marked and the carbon ads plugin. I've already submitted fixes for marked (markedjs/marked#1877) and will address carbon ads soon. My tests in IE11 were done with a patched version of marked.

sy-records reacted with thumbs up emoji
@sy-records
Copy link
MemberAuthor

sy-records commentedDec 15, 2020
edited
Loading

@jhildenbiddle Thanks for the test.

The third one is solved.

The second is an escapeHtml, I don t know how to deal with it for the time being. Solve by removed.

The first question, I need to think about how to modify... 😂 That's it for now. If the original characters are used, the searched characters will not be selected, later we look at how to optimise the search plugin.

jhildenbiddle reacted with thumbs up emoji

Copy link
Member

@anikethsahaanikethsaha left a comment

Choose a reason for hiding this comment

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

one small suggestion.
Otherwise great stuff.

THanks@sy-records

};
awaitdocsifyInit(docsifyInitConfig);
awaitpage.fill('input[type=search]','documentacion');
awaitexpect(page).toEqualText('.results-panel h2','Que es');
Copy link
Member

Choose a reason for hiding this comment

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

is it possible to show the accent in the result ?

sorry if I missed any previous discussion regarding this. LMK

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I don't have a good idea how to do it...

Copy link
Member

Choose a reason for hiding this comment

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

Looks like@sy-records got 2 of the 3 I listed. Perhaps we should open a new issue regarding missing diacritical marks in the search results so we can merge and release this PR.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

done.#1491

Copy link
Member

Choose a reason for hiding this comment

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

Created a new issue for missing diacritical remarks in search results (#1492).

Copy link
Member

@jhildenbiddlejhildenbiddle left a comment

Choose a reason for hiding this comment

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

LGTM

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

Reviewers

@jhildenbiddlejhildenbiddlejhildenbiddle approved these changes

@Koooooo-7Koooooo-7Awaiting requested review from Koooooo-7

@trusktrtrusktrAwaiting requested review from trusktr

@anikethsahaanikethsahaAwaiting requested review from anikethsaha

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

search accents marks

3 participants

@sy-records@jhildenbiddle@anikethsaha

[8]ページ先頭

©2009-2025 Movatter.jp