This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ActionView::Template::Handlers::Liquid | |
| def self.call(template) | |
| "ActionView::Template::Handlers::Liquid.new(self).render(#{template.source.inspect}, local_assigns)" | |
| end | |
| def initialize(view) | |
| @view = view | |
| end | |
| def render(template, local_assigns = {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## | |
| # Get the context for a search term and highlight the term itself | |
| # text: string containing the search term and additional information | |
| # term: string with the term you're looking for | |
| # words: int for how many words to include total | |
| # padding_left: int for characters to the left of the search term | |
| # padding_right: int for characters to the right of the search term | |
| # | |
| # Only handles the first instance of a given term. Can be modified to take | |
| # character positions denoting the start and stop of term(s). |
NewerOlder