Skip to content

Instantly share code, notes, and snippets.

View ricokareem's full-sized avatar
:octocat:

Rico Rodriquez Collins ricokareem

:octocat:
View GitHub Profile
@ricokareem
ricokareem / HighlightedResults.jsx
Created January 26, 2021 19:11
[React] Highlight search string matches in results without dangerouslySetInnerHTML
// Highlight search string matches in results
const HighlightedResults = (): JSX.Element | null => {
if (inputValue) {
const match = item.name.match(new RegExp(inputValue, 'i'))
const MatchEl = (): ReactElement | null => {
if (match && match.length) {
return <strong>{match[0]}</strong>
} else {
return null
}
@ricokareem
ricokareem / gist:e05b6d5d6f27856336bde7378a6ce94f
Created April 29, 2021 15:57 — forked from clintel/gist:1155906
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code