Changeset 415


Ignore:
Timestamp:
Jun 28, 2016, 4:59:47 AM (3 years ago)
Author:
lars@…
Message:

Also honor no-urlify on current element

Location:
www/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • www/lib/filter_meeting.rb

    r411 r415  
    99  def run(content, params={})
    1010    doc = Nokogiri::HTML(content.dup)
    11     elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")])]/text()')
     11    elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")]) and not(self::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")])]/text()')
    1212    elements.each do |element|
    1313      element.content = element.content.gsub(/\bIETF-([0-9]{1,3}\b)/) {
  • www/lib/filter_rfc.rb

    r411 r415  
    99  def run(content, params={})
    1010    doc = Nokogiri::HTML(content.dup)
    11     elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")])]/text()')
     11    elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")]) and not(self::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")])]/text()')
    1212    elements.each do |element|
    1313      element.content = element.content.gsub(/RFC\s*([0-9]{1,5})/i) {
  • www/lib/filter_rg.rb

    r411 r415  
    99  def run(content, params={})
    1010    doc = Nokogiri::HTML(content.dup)
    11     elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")])]/text()')
     11    elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")]) and not(self::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")])]/text()')
    1212    elements.each do |element|
    1313      element.content = element.content.gsub(/\b(#{$rgs.keys.join('|').upcase})\b/) {
  • www/lib/filter_url.rb

    r409 r415  
    9696    @@urls.keys.sort_by {|x| x.length}.reverse.each do |tag|
    9797      doc = Nokogiri::HTML(c)
    98       elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")])]/text()')
     98      elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")]) and not(self::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")])]/text()')
    9999      elements.each do |element|
    100100        element.content = element.content.gsub(/\b(#{tag})\b/) {
  • www/lib/filter_wg.rb

    r411 r415  
    7474  def run(content, params={})
    7575    doc = Nokogiri::HTML(content.dup)
    76     elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")])]/text()')
     76    elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")]) and not(self::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")])]/text()')
    7777    elements.each do |element|
    7878      element.content = element.content.gsub(/\b(#{@@active.join('|').upcase})\b/) {
Note: See TracChangeset for help on using the changeset viewer.