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

fix #582 and #824 #1015

Merged
merged 1 commit into from
Feb 7, 2020
Merged

fix #582 and #824 #1015

merged 1 commit into from
Feb 7, 2020

Conversation

sy-records
Copy link
Member

@sy-records sy-records commented Feb 5, 2020

Summary
fix #582 and #824, I also encountered this problem, tried to fix and update a bit.

Fix the problem that the content of the table cannot be searched, But there are still some problems here, adding some descriptions will not search.

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:

In #824 , he did not provide test cases, I provide here.

## Fix the problem that the content of the table cannot be searched

Color   | RGB
----  | ----
Snow  | 255 250 250
Blue  | 0 0 255

## But there are still some problems here

adding some descriptions will not search. 

Color   | RGB
----  | ----
Snow1  | 255 250 250
Blue1  | 0 0 255

73818311-064fb480-4828-11ea-9f1f-6312eb35488c_meitu_2
73818338-18315780-4828-11ea-97d1-0bc01b658bea_meitu_1


  • DO NOT include files inside lib directory.

Copy link
Member

@anikethsaha anikethsaha left a comment

Choose a reason for hiding this comment

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

Also, if we consider fuzzy for searching #841 , then I guess this changes will break

Comment on lines +74 to +81
if (!token.text) {
if (token.type === 'table') {
token.text = token.cells.map(function (rows) {
return rows.join(' | ')
}).join(' |\n ')
}
}

Copy link
Member

Choose a reason for hiding this comment

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

This is from #582 right ?
I guess we should wait for his response for a while if its inactive then we can work here

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but I need to use it. I'm not sure what problems will be caused by this modification, and I can't find it after adding some descriptions mentioned in the test case. How should I solve this?

Copy link
Member

@anikethsaha anikethsaha Feb 5, 2020

Choose a reason for hiding this comment

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

These changes look fine to me, and I think it won't break anything else.

cc @docsifyjs/core , can you guys review this

@anikethsaha anikethsaha requested a review from a team February 5, 2020 16:29
Copy link
Member

@anikethsaha anikethsaha left a comment

Choose a reason for hiding this comment

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

Nice, lets wait for #582 for a while and review from other members 👍

@sy-records
Copy link
Member Author

Sorry, I am not a front-end developer and I am not very familiar with front-end.😅
Is there any other way to search in the table? I can use it after building js myself.

@anikethsaha
Copy link
Member

token-based searching is one of the ways and the changes you did seems like that.
I am not sure how other searching libs (fuzzy) does that.

@sy-records
Copy link
Member Author

OK, thanks.

@anikethsaha anikethsaha requested a review from a team February 5, 2020 18:36
Copy link
Contributor

@jthegedus jthegedus left a comment

Choose a reason for hiding this comment

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

LGTM too

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.

It does not search inside tables
3 participants