mvgroup*: improvements to optional bbc title stripping

1. do not filter 'BBC ' from anywhere but the start of the title string
2. condense the two optional title blocks into a single title block
This commit is contained in:
Garfield69 2018-01-09 07:40:13 +13:00
parent 7f59ae0b6f
commit 70ca19c6d9
2 changed files with 6 additions and 18 deletions

View File

@ -130,20 +130,14 @@
selector: tr:has(a.magnetlink)
fields:
title:
# fallback title (to prevent abend if neither optional is found)
# fallback title (to prevent abend if optional is not found)
text: "title not found"
title:
optional: true
selector: td.singleindent a[href^="/index.php?showtopic="]
selector: td.doubleindent, td.singleindent a[href^="/index.php?showtopic="]
filters:
- name: re_replace
args: ["BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"]
title:
optional: true
selector: td.doubleindent
filters:
- name: re_replace
args: ["BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"]
args: ["^BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"]
details:
optional: true
selector: td.singleindent a[href^="/index.php?showtopic="]

View File

@ -130,20 +130,14 @@
selector: tr:has(a.magnetlink)
fields:
title:
# fallback title (to prevent abend if neither optional is found)
# fallback title (to prevent abend if optional is not found)
text: "title not found"
title:
optional: true
selector: td.singleindent a[href^="/index.php?showtopic="]
selector: td.doubleindent, td.singleindent a[href^="/index.php?showtopic="]
filters:
- name: re_replace
args: ["BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"]
title:
optional: true
selector: td.doubleindent
filters:
- name: re_replace
args: ["BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"]
args: ["^BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"]
details:
optional: true
selector: td.singleindent a[href^="/index.php?showtopic="]