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

Highlighting a full word is dropping spaces #15

Closed
kgrammer opened this issue Mar 6, 2019 · 3 comments
Closed

Highlighting a full word is dropping spaces #15

kgrammer opened this issue Mar 6, 2019 · 3 comments

Comments

@kgrammer
Copy link

kgrammer commented Mar 6, 2019

When I highlight a full word or any part of a word that has a leading or trailing space, the space(s) are dropped.

For example, if I have a text that is "This is a test text string" and I search for "test", the word test is highlight, but the string is built so that it is displayed as "This is atesttext string" with "test" highlighted.

The HTML is built like:
this is a
test
text string

So when rendered, the spaces before and after "test" are lost.

Is there a fix for this?

@kgrammer kgrammer changed the title Highlighted full work Item dropping spaces Highlighting a full word is dropping spaces Mar 6, 2019
@knownasilya
Copy link
Owner

That is purely a style issue. Maybe give something like this a try

.highlight {
  background-color: #FFF2B4;
  border-radius: 2px;
  padding: 0 1px;
}

@kgrammer
Copy link
Author

kgrammer commented Mar 6, 2019

Well, its not just a style difference. if using the same example above and I seach for "es", the span is included inline with the text so that only the "es" portion of test is highlighted.

Also, if I use the example you provided, I would get the spacing for partial words and it still won't solve the problem where the span is not inline with the rest of the text.

If you email me at kgrammer@rvhsolutions.com I can point you to a site and show you the problem in the real world.

@kgrammer
Copy link
Author

kgrammer commented Mar 6, 2019

OK, I have two different results on two different uses, so what I will do is delete this request and reopen it if I can't determine the cause.

Sorry for the confusion.

@kgrammer kgrammer closed this as completed Mar 6, 2019
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

No branches or pull requests

2 participants