Skip to content

Commit

Permalink
improve compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
elmorec committed Mar 2, 2019
1 parent bcff5d5 commit 9af28ca
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "8"
- "10"
branches:
only:
- master
Expand Down
4 changes: 2 additions & 2 deletions layout/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<link rel="icon" type="image/x-icon" href="<%= url_for(theme.favicon) %>">
<% if (theme.pwa.manifest) { -%>
<link rel="manifest" href="<%= url_for('manifest.json') %>">
<% } -%>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="translucent">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<% } -%>
<%- open_graph({ image: page.thumbnail || theme.profile.avatar }) %>
<% if (config.feed && config.feed.path) { -%>
<link rel="alternate" type="application/atom+xml" title="<%= config.title %>" href="<%= url_for(config.feed.path) %>">
Expand Down
2 changes: 1 addition & 1 deletion lib/filter/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ module.exports = function (data) {
const $el = $(this);

// Note modifying this affects parseToc()
$el.html($el.text() + `<a href="${link}#${$el.attr('id')}"></a>`);
$el.find('a').remove().end().append(`<a href="${link}#${$el.attr('id')}"></a>`);
});

return $.html();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-inside",
"version": "2.1.0-beta.0",
"version": "2.1.0-beta.1",
"description": "❤️ SPA, flat and clean theme for Hexo.",
"scripts": {
"test": "jasmine --config=test/jasmine.json"
Expand Down
10 changes: 7 additions & 3 deletions test/scripts/filters/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ describe('post', function () {

post.call(this.ctx, data);
expect(data.content).toBe('<h2 id="Title">Title<a href="post/test#Title"></a></h2>');

data.content = '<h2 id="Title"><a href="#Title" class="headerlink" title="Title"></a><span>Title</span></h2>';
post.call(this.ctx, data);
expect(data.content).toBe('<h2 id="Title"><span>Title</span><a href="post/test#Title"></a></h2>');
})

it('add additional tag for table and remove empty thead', function () {
Expand All @@ -130,10 +134,10 @@ describe('post', function () {

post.call(this.ctx, data);

expect(data.content).toBe(
'<div class="article-img"><p><img data-zoomable=""></p></div>' +
expect(data.content.replace(/\=\"\"/g, '')).toBe(
'<div class="article-img"><p><img data-zoomable></p></div>' +
'<p>img<img></p>' +
'<div class="article-img"><p><img data-zoomable=""><img data-zoomable=""></p></div>');
'<div class="article-img"><p><img data-zoomable><img data-zoomable></p></div>');
});

it('add additional tag for script', function () {
Expand Down

0 comments on commit 9af28ca

Please sign in to comment.