googler 3.8
===========
- [x] Have you followed the [guidelines for contributing](https://github.com/Homebrew/homebrew-core/blob/master/CONTRIBUTING.md)?
- [x] Have you checked that there aren't other open [pull requests](https://github.com/Homebrew/homebrew-core/pulls) for the same formula update/change?
- [x] Have you built your formula locally with `brew install --build-from-source <formula>`, where `<formula>` is the name of the formula you're submitting?
- [x] Is your test running fine `brew test <formula>`, where `<formula>` is the name of the formula you're submitting?
- [x] Does your build pass `brew audit --strict <formula>` (after doing `brew install <formula>`)?
-----
<img width="446" alt="Screen Shot 2019-03-27 at 10 42 54 PM" src="https://user-images.githubusercontent.com/4149852/55085526-c8e7aa00-50e1-11e9-86a1-1bf06cb2b0b4.png">
Looking at the email, for a second there I thought you recruited a new maintainer.
There's one caveat: Note that in order to make metadata of news entries look nicer, we do this transformation on metadata text:
```py
metadata = metadata.replace('\u200e', '').replace(' - ', ', ').strip() # .strip() is new but inconsequential
```
However, when we search for a movie, this is what happens:
```console
$ googler -n 1 --np avatar
1. Avatar (2009) - IMDb
https://www.imdb.com/title/tt0499549/
Rating: 7.8/10 - 1,032,269 votes
Photos. Sam Worthington in Avatar (2009) Wes Studi in Avatar (2009) Avatar prop in the Profiles in History booth Sigourney Weaver at an event for
Avatar (2009) ...
```
Why isn't "Rating: 7.8/10 - 1,032,269 votes" transformed into "Rating: 7.8/10, 1,032,269 votes" (less readable)? Interestingly, with our `googler/*` user agent, this is the actual HTML of the `div.slp`:
```html
<div class="f slp"><div class="star"><div style="width:52px"> </div></div> Rating: 7.8/10 - 1,032,269 votes</div>
```
so the hyphen is surrounded by ` `'s (i.e., U+00A0) instead of spaces; that's why the transform doesn't work (happy coincidence). However, when I search in Chrome, this is the HTML for the `div.slp`:
```html
<div class="slp f"><g-review-stars><span class="fTKmHE99XE4__star-default" aria-label="Rated 4.0 out of 5,"><span style="width:53px"></span></span></g-review-stars> Rating: 7.8/10 - 1,032,269 votes</div>
```
so if we were parsing this HTML instead, the undesirable transform would kick in, and there may be a future date (or maybe even a Google variant today) when it kicks in for our user agent too.
Anyway, not that big a deal, just documenting this in case of future confusion. (Basically, to future self: I thought about this.)
Enable result metadata extraction in Search mode
================================================
Result metadata (contained in a div.slp in search results) was originally
designed to be extracted in News mode, for publisher name and time of
publishing. (In Search mode, the most important metadata -- date of the page,
when available -- is already contained in the abstract itself. Maybe this info
could be promoted to the separate metadata field, but that's the topic for
another day.)
However, the old parser did not explicitly restrict the extraction to News
mode, which unintentionally let through useful information, e.g., IMDb rating
when searching for a movie. The new parser (ad965d6) instead restricted
metadata extraction to News mode, causing a regression in certain cases.
This commit removes the limitation and allows metadata extraction whenever
possible.
Option to avoid external requests to CDNJS and Google Fonts?
============================================================
I just tried Wiki.js v2 using the requarks/wiki:beta Docker image. Overall it's very pleasant, but I was slightly surprised to see external requests to CDNJS for `material-design-iconic-font` and Google Fonts for Roboto, Varela Round, Source Code Pro and Material Icons. I host my Wiki.js instance on my LAN and would prefer everything to be local for both performance and privacy reasons. AFAIK v1 was entirely local, so this is to some extent a regression for me.
(General arguments against CDNJS and Google Fonts: (1) They aren't universally fast around the world -- Google Fonts isn't even available in China, for instance. (2) Some people are inevitably going to be uncomfortable with Google tracking on a self-hosted service -- yeah I noticed `Referer Policy: same-origin` which is a good start, but still.)
Maybe an entirely self-hosted option could be made available? If there are license issues with Google Fonts (?), some DIY pointers would be much appreciated.
---
### Actual behavior
External requests to CDNJS and Google Fonts.
### Expected behavior
At least an option to self-host all the assets.
### Steps to reproduce the behavior
Self-explanatory.