Updated @tryghost/url-utils to v0.3.0 (#11027)

refs https://github.com/TryGhost/Ghost/issues/10793

- fixes `urlUtils.htmlRelativeToAbsolute` mangling attribute quote styles and removing indentation
This commit is contained in:
Kevin Ansfield 2019-08-16 00:26:24 +01:00 committed by GitHub
parent 523be3879f
commit 61420ae67f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 10 deletions

View File

@ -124,7 +124,7 @@ function getAmperizeHTML(html, post) {
amperize = amperize || new Amperize();
// make relative URLs abolute
html = urlUtils.htmlRelativeToAbsolute(html, urlUtils.urlFor('home', true), post.url).html();
html = urlUtils.htmlRelativeToAbsolute(html, urlUtils.urlFor('home', true), post.url);
if (!amperizeCache[post.id] || moment(new Date(amperizeCache[post.id].updated_at)).diff(new Date(post.updated_at)) < 0) {
return new Promise((resolve) => {

View File

@ -1,5 +1,6 @@
var downsize = require('downsize'),
Promise = require('bluebird'),
cheerio = require('cheerio'),
RSS = require('rss'),
urlUtils = require('../../../server/lib/url-utils'),
urlService = require('../url'),
@ -22,7 +23,7 @@ generateTags = function generateTags(data) {
generateItem = function generateItem(post, siteUrl, secure) {
var itemUrl = urlService.getUrlByResourceId(post.id, {secure: secure, absolute: true}),
htmlContent = urlUtils.htmlRelativeToAbsolute(post.html, siteUrl, itemUrl),
htmlContent = cheerio.load(urlUtils.htmlRelativeToAbsolute(post.html, siteUrl, itemUrl), {decodeEntities: false}),
item = {
title: post.title,
// @TODO: DRY this up with data/meta/index & other excerpt code

View File

@ -60,7 +60,7 @@ const forPost = (id, attrs, frame) => {
urlUtils.urlFor('home', true),
attrs.url,
urlOptions
).html();
);
}
if (frame.options.columns && !frame.options.columns.includes('url')) {

View File

@ -22,7 +22,7 @@ const urlsForPost = (id, attrs, options) => {
}
if (attrs.html) {
attrs.html = urlUtils.htmlRelativeToAbsolute(attrs.html, urlUtils.urlFor('home', true), attrs.url).html();
attrs.html = urlUtils.htmlRelativeToAbsolute(attrs.html, urlUtils.urlFor('home', true), attrs.url);
}
if (attrs.url) {

View File

@ -60,7 +60,7 @@ const forPost = (id, attrs, frame) => {
urlUtils.urlFor('home', true),
attrs.url,
urlOptions
).html();
);
}
if (frame.options.columns && !frame.options.columns.includes('url')) {

View File

@ -48,7 +48,7 @@
"@tryghost/members-theme-bindings": "0.2.3",
"@tryghost/social-urls": "0.1.1",
"@tryghost/string": "^0.1.3",
"@tryghost/url-utils": "0.2.0",
"@tryghost/url-utils": "0.3.0",
"ajv": "6.10.2",
"amperize": "0.6.0",
"analytics-node": "3.3.0",

View File

@ -267,10 +267,10 @@
dependencies:
unidecode "^0.1.8"
"@tryghost/url-utils@0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@tryghost/url-utils/-/url-utils-0.2.0.tgz#d32b23122ea78b23a63c6ab25d160cbf4f65e53e"
integrity sha512-/Ex9z8RUAfAek8z7EMvnDBIV5P88jwL1X4KwXxZy5udn0aQShvSwsO5euOpUcjBOn2ZsUT3aXYsB+pz7uXm8hw==
"@tryghost/url-utils@0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@tryghost/url-utils/-/url-utils-0.3.0.tgz#59f101945f56b0e53d8b8ad394c47538beb33d0b"
integrity sha512-a0MKw054P6VRAbqqx2C61Tj2RskRouBMt31+tVFCT+Lyy+FxaQD18I/n+pwlnNd6Z5BF+Bi2etSnS3ldRsOfQg==
dependencies:
cheerio "0.22.0"
lodash "4.17.11"