Skip to content

fix #1118 #1121

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

Merged
merged 7 commits into from
Apr 19, 2020
Merged

fix #1118 #1121

merged 7 commits into from
Apr 19, 2020

Conversation

sy-records
Copy link
Member

@sy-records sy-records commented Apr 16, 2020

Summary

fix #1118

This modification will ensure that the search content and body rendering are consistent.

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

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

If changing the UI of default theme, please provide the before/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)

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

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new 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 a feature request issue first and wait for approval before working on it.

Other information:


  • DO NOT include files inside lib directory.

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.

thx for ur input, feel free to make it better .:+1:

@sy-records
Copy link
Member Author

@Koooooo-7 Sorry, I still keep my opinion.
Can you let other team members also come to review?
The markdown rendering of the text uses marked, which also replaces & <>" '
image
After this pr is modified, token.text, markdown, and sidebar will be consistent.

@sy-records sy-records requested a review from Koooooo-7 April 17, 2020 01:27
@Koooooo-7
Copy link
Member

@sy-records yep, I will look on it also.

@anikethsaha could u review this PR about those changes.

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.

const matchContent =
            '...' +
            escapeHtml(postContent)
              .substring(start, end)
              .replace(regEx, `<em class="search-keyword">${keyword}</em>`) +
            '...';

and I think u need consider on this place together also.

@sy-records
Copy link
Member Author

const matchContent =
            '...' +
            escapeHtml(postContent)
              .substring(start, end)
              .replace(regEx, `<em class="search-keyword">${keyword}</em>`) +
            '...';

and I think u need consider on this place together also.

Is there any problem here? / not searchable?

@Koooooo-7
Copy link
Member

Koooooo-7 commented Apr 17, 2020

const matchContent =
            '...' +
            escapeHtml(postContent)
              .substring(start, end)
              .replace(regEx, `<em class="search-keyword">${keyword}</em>`) +
            '...';

and I think u need consider on this place together also.

Is there any problem here? / not searchable?

nah, cuz we don't have good test now, so I hope u could make sure the changes about all the escapeHtml place.
Right now I think your changes works after tested again. just make sure it.
good job:+1:

@sy-records
Copy link
Member Author

Well, I tried it without problems.
If it existed before, it will be escaped:[test](/test) [test](&#x2F;test)

@Koooooo-7
Copy link
Member

Well, I tried it without problems.
If it existed before, it will be escaped:[test](/test) [test](&#x2F;test)

okay, thx again.
LGTM. 💯

@anikethsaha anikethsaha requested a review from trusktr April 17, 2020 06:22
@Koooooo-7
Copy link
Member

please , squash the commits (with clearly commit message) then we are good to merge. 👍

@anikethsaha
Copy link
Member

@Koooooo-7 we can do squash and merge while merging, we will add an appropriate message for it according to our commit message convention.
if you want, you can squash and merge it now as well 👍

I am waiting for @trusktr 's review, we can merge this after 2-3 days if he is in-active .
👍

@anikethsaha anikethsaha merged commit dcb0aae into docsifyjs:develop Apr 19, 2020
@sy-records sy-records deleted the fix-1118 branch April 19, 2020 14:19
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.

Inconsistent search and body rendering
3 participants