MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / get_highlighted_text

Method get_highlighted_text

src/licensedcode/match.py:842–855  ·  view source on GitHub ↗

Return HTML representing the full text of the original scanned file where the matched text portions and the non-matched text portions are highlighted using HTML tags.

(self, trace=TRACE_HIGHLIGHTED_TEXT)

Source from the content-addressed store, hash-verified

840 return result
841
842 def get_highlighted_text(self, trace=TRACE_HIGHLIGHTED_TEXT):
843 """
844 Return HTML representing the full text of the original scanned file
845 where the matched text portions and the non-matched text portions are
846 highlighted using HTML tags.
847 """
848 if trace:
849 logger_debug(f'LicenseMatch.get_highlighted_text: self.query: {self.query}')
850
851 query = self.query
852 if not query:
853 return u''
854
855 return ''.join(get_highlighted_lines(match=self, query=query, trace=trace))
856
857
858def set_matched_lines(matches, line_by_pos):

Callers

nothing calls this directly

Calls 3

get_highlighted_linesFunction · 0.85
logger_debugFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected