Changeset 411


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

Respect the no-urlify class

Location:
www/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • www/lib/filter_meeting.rb

    r391 r411  
    99  def run(content, params={})
    1010    doc = Nokogiri::HTML(content.dup)
    11     elements = doc.xpath('//text()') - doc.xpath('//a/text()')
     11    elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[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

    r391 r411  
    99  def run(content, params={})
    1010    doc = Nokogiri::HTML(content.dup)
    11     elements = doc.xpath('//text()') - doc.xpath('//a/text()')
     11    elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[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

    r391 r411  
    99  def run(content, params={})
    1010    doc = Nokogiri::HTML(content.dup)
    11     elements = doc.xpath('//text()') - doc.xpath('//a/text()')
     11    elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[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_wg.rb

    r391 r411  
    7070run ssh stdguide trainmat userdoc userdoc2 userglos weird wnils
    7171uswg
    72 
    7372  ]
    7473
    7574  def run(content, params={})
    7675    doc = Nokogiri::HTML(content.dup)
    77     elements = doc.xpath('//text()') - doc.xpath('//a/text()')
     76    elements = doc.xpath('//*[local-name() != "a" and not(ancestor::*[contains(concat(" ", normalize-space(@class), " "), " no-urlify ")])]/text()')
    7877    elements.each do |element|
    7978      element.content = element.content.gsub(/\b(#{@@active.join('|').upcase})\b/) {
Note: See TracChangeset for help on using the changeset viewer.