mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
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:
parent
523be3879f
commit
61420ae67f
@ -124,7 +124,7 @@ function getAmperizeHTML(html, post) {
|
|||||||
amperize = amperize || new Amperize();
|
amperize = amperize || new Amperize();
|
||||||
|
|
||||||
// make relative URLs abolute
|
// 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) {
|
if (!amperizeCache[post.id] || moment(new Date(amperizeCache[post.id].updated_at)).diff(new Date(post.updated_at)) < 0) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
var downsize = require('downsize'),
|
var downsize = require('downsize'),
|
||||||
Promise = require('bluebird'),
|
Promise = require('bluebird'),
|
||||||
|
cheerio = require('cheerio'),
|
||||||
RSS = require('rss'),
|
RSS = require('rss'),
|
||||||
urlUtils = require('../../../server/lib/url-utils'),
|
urlUtils = require('../../../server/lib/url-utils'),
|
||||||
urlService = require('../url'),
|
urlService = require('../url'),
|
||||||
@ -22,7 +23,7 @@ generateTags = function generateTags(data) {
|
|||||||
|
|
||||||
generateItem = function generateItem(post, siteUrl, secure) {
|
generateItem = function generateItem(post, siteUrl, secure) {
|
||||||
var itemUrl = urlService.getUrlByResourceId(post.id, {secure: secure, absolute: true}),
|
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 = {
|
item = {
|
||||||
title: post.title,
|
title: post.title,
|
||||||
// @TODO: DRY this up with data/meta/index & other excerpt code
|
// @TODO: DRY this up with data/meta/index & other excerpt code
|
||||||
|
@ -60,7 +60,7 @@ const forPost = (id, attrs, frame) => {
|
|||||||
urlUtils.urlFor('home', true),
|
urlUtils.urlFor('home', true),
|
||||||
attrs.url,
|
attrs.url,
|
||||||
urlOptions
|
urlOptions
|
||||||
).html();
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame.options.columns && !frame.options.columns.includes('url')) {
|
if (frame.options.columns && !frame.options.columns.includes('url')) {
|
||||||
|
@ -22,7 +22,7 @@ const urlsForPost = (id, attrs, options) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (attrs.html) {
|
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) {
|
if (attrs.url) {
|
||||||
|
@ -60,7 +60,7 @@ const forPost = (id, attrs, frame) => {
|
|||||||
urlUtils.urlFor('home', true),
|
urlUtils.urlFor('home', true),
|
||||||
attrs.url,
|
attrs.url,
|
||||||
urlOptions
|
urlOptions
|
||||||
).html();
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame.options.columns && !frame.options.columns.includes('url')) {
|
if (frame.options.columns && !frame.options.columns.includes('url')) {
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
"@tryghost/members-theme-bindings": "0.2.3",
|
"@tryghost/members-theme-bindings": "0.2.3",
|
||||||
"@tryghost/social-urls": "0.1.1",
|
"@tryghost/social-urls": "0.1.1",
|
||||||
"@tryghost/string": "^0.1.3",
|
"@tryghost/string": "^0.1.3",
|
||||||
"@tryghost/url-utils": "0.2.0",
|
"@tryghost/url-utils": "0.3.0",
|
||||||
"ajv": "6.10.2",
|
"ajv": "6.10.2",
|
||||||
"amperize": "0.6.0",
|
"amperize": "0.6.0",
|
||||||
"analytics-node": "3.3.0",
|
"analytics-node": "3.3.0",
|
||||||
|
@ -267,10 +267,10 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
unidecode "^0.1.8"
|
unidecode "^0.1.8"
|
||||||
|
|
||||||
"@tryghost/url-utils@0.2.0":
|
"@tryghost/url-utils@0.3.0":
|
||||||
version "0.2.0"
|
version "0.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/@tryghost/url-utils/-/url-utils-0.2.0.tgz#d32b23122ea78b23a63c6ab25d160cbf4f65e53e"
|
resolved "https://registry.yarnpkg.com/@tryghost/url-utils/-/url-utils-0.3.0.tgz#59f101945f56b0e53d8b8ad394c47538beb33d0b"
|
||||||
integrity sha512-/Ex9z8RUAfAek8z7EMvnDBIV5P88jwL1X4KwXxZy5udn0aQShvSwsO5euOpUcjBOn2ZsUT3aXYsB+pz7uXm8hw==
|
integrity sha512-a0MKw054P6VRAbqqx2C61Tj2RskRouBMt31+tVFCT+Lyy+FxaQD18I/n+pwlnNd6Z5BF+Bi2etSnS3ldRsOfQg==
|
||||||
dependencies:
|
dependencies:
|
||||||
cheerio "0.22.0"
|
cheerio "0.22.0"
|
||||||
lodash "4.17.11"
|
lodash "4.17.11"
|
||||||
|
Loading…
Reference in New Issue
Block a user