useless change
This commit is contained in:
10
src/api.ts
10
src/api.ts
@@ -93,9 +93,9 @@ function readHTML(html: string): uniteApiData {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//filter down to just ones named "og:..."
|
//filter down to just ones named "og:..."
|
||||||
metaElems = metaElems.filter((el: cheerio.Element) => el.attribs.property?.startsWith('og:'));
|
metaElems = metaElems.filter(el => el.attribs.property?.startsWith('og:'));
|
||||||
|
|
||||||
metaElems.forEach((el: cheerio.Element) => {
|
metaElems.forEach(el => {
|
||||||
let attr = el.attribs;
|
let attr = el.attribs;
|
||||||
|
|
||||||
if (attr.property === 'og:title') {
|
if (attr.property === 'og:title') {
|
||||||
@@ -107,7 +107,7 @@ function readHTML(html: string): uniteApiData {
|
|||||||
} else if (attr.property === 'og:description') {
|
} else if (attr.property === 'og:description') {
|
||||||
|
|
||||||
//all lines
|
//all lines
|
||||||
let lines = attr.content.split('\n').map((l: string) => l.trim()),
|
let lines = attr.content.split('\n').map(l => l.trim()),
|
||||||
extraLines: string[] = [];
|
extraLines: string[] = [];
|
||||||
|
|
||||||
//ensure first line is correct
|
//ensure first line is correct
|
||||||
@@ -162,9 +162,9 @@ function readHTML(html: string): uniteApiData {
|
|||||||
lines.shift();
|
lines.shift();
|
||||||
|
|
||||||
//rest of lines
|
//rest of lines
|
||||||
lines.forEach((line: string) => {
|
lines.forEach(line => {
|
||||||
|
|
||||||
let split = line.split(':').map((l: string) => l.trim()),
|
let split = line.split(':').map(l => l.trim()),
|
||||||
key = split[0].toLowerCase().replace(/[^\w]/g, ''),
|
key = split[0].toLowerCase().replace(/[^\w]/g, ''),
|
||||||
value = split[1];
|
value = split[1];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user