Skip to content

Commit

Permalink
Merge branch 'release/1.4.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
yzane committed Mar 11, 2020
2 parents 138420f + 997b561 commit 487f22a
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 105 deletions.
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ jsconfig.json
work/**
*.bat
.eslintrc.json
sample/**
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## 1.4.3 (2020/03/12)
* Fix: markdown-include regular expression
* Fix: Unable to export to pdf from markdown [#166](https://github.com/yzane/vscode-markdown-pdf/issues/166)
* Fix: python code export err [#178](https://github.com/yzane/vscode-markdown-pdf/issues/178)
* Fix: Add support for Ubuntu and Centos
* Fix: Error: Failed to lanuch chrome! [#97](https://github.com/yzane/vscode-markdown-pdf/issues/97)
* Fix: I failed to launch chrome in WSL [#160](https://github.com/yzane/vscode-markdown-pdf/issues/160)
* Fix: Unable to export to pdf from markdown [#166](https://github.com/yzane/vscode-markdown-pdf/issues/166)

## 1.4.2 (2020/02/16)
* Add: Support [gray-matter](https://github.com/jonschlinkert/gray-matter) (preview)
* Avoid to display front matter [#157](https://github.com/yzane/vscode-markdown-pdf/pull/157)
Expand Down
20 changes: 9 additions & 11 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ OUTPUT

## インストール

Markdown PDF をインストールして、Visutal Studio Code で Markdownファイルを最初に開いた時、Chromium のダウンロードが自動で始まります。
Markdown PDF をインストールして、Visual Studio Code で Markdownファイルを最初に開いた時、Chromium のダウンロードが自動で始まります。

しかしサイズが大きい為 (~170Mb Mac, ~282Mb Linux, ~280Mb Win) 、環境によっては時間がかかります。
ダウンロード中は、ステータスバーに `Installing Puppeteer` のメッセージが表示されます。
Expand Down Expand Up @@ -560,16 +560,14 @@ Visual Studio Code の `files.autoGuessEncoding` オプションを使うと、

## [Release Notes](CHANGELOG.md)

### 1.4.2 (2020/02/16)
* Add: Support [gray-matter](https://github.com/jonschlinkert/gray-matter) (preview)
* Avoid to display front matter [#157](https://github.com/yzane/vscode-markdown-pdf/pull/157)
* Currently, only some settings can be specified.
* Fix: Improve the configuration schema of package.json
* Some settings can now be set from the settings editor.
* Fix: Specifying custom style sheets with a relative path does not work [#170](https://github.com/yzane/vscode-markdown-pdf/pull/170)
* Fix: Pass language to markdown-pdf puppeteer [#172](https://github.com/yzane/vscode-markdown-pdf/pull/172)
* Date Format [#95](https://github.com/yzane/vscode-markdown-pdf/issues/95)
* Improve: Reduce Regex strictness of markdown-it-include [#174](https://github.com/yzane/vscode-markdown-pdf/pull/174)
### 1.4.3 (2020/03/12)
* Fix: markdown-include regular expression
* Fix: Unable to export to pdf from markdown [#166](https://github.com/yzane/vscode-markdown-pdf/issues/166)
* Fix: python code export err [#178](https://github.com/yzane/vscode-markdown-pdf/issues/178)
* Fix: Add support for Ubuntu and Centos
* Fix: Error: Failed to lanuch chrome! [#97](https://github.com/yzane/vscode-markdown-pdf/issues/97)
* Fix: I failed to launch chrome in WSL [#160](https://github.com/yzane/vscode-markdown-pdf/issues/160)
* Fix: Unable to export to pdf from markdown [#166](https://github.com/yzane/vscode-markdown-pdf/issues/166)


## License
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ OUTPUT

## Install

Chromium download starts automatically when Markdown PDF is installed and Markdown file is first opened with Visutal Studio Code.
Chromium download starts automatically when Markdown PDF is installed and Markdown file is first opened with Visual Studio Code.

However, it is time-consuming depending on the environment because of its large size (~ 170Mb Mac, ~ 282Mb Linux, ~ 280Mb Win).

Expand Down Expand Up @@ -566,16 +566,14 @@ Please use the following to insert a page break.

## [Release Notes](CHANGELOG.md)

### 1.4.2 (2020/02/16)
* Add: Support [gray-matter](https://github.com/jonschlinkert/gray-matter) (preview)
* Avoid to display front matter [#157](https://github.com/yzane/vscode-markdown-pdf/pull/157)
* Currently, only some settings can be specified.
* Fix: Improve the configuration schema of package.json
* Some settings can now be set from the settings editor.
* Fix: Specifying custom style sheets with a relative path does not work [#170](https://github.com/yzane/vscode-markdown-pdf/pull/170)
* Fix: Pass language to markdown-pdf puppeteer [#172](https://github.com/yzane/vscode-markdown-pdf/pull/172)
* Date Format [#95](https://github.com/yzane/vscode-markdown-pdf/issues/95)
* Improve: Reduce Regex strictness of markdown-it-include [#174](https://github.com/yzane/vscode-markdown-pdf/pull/174)
### 1.4.3 (2020/03/12)
* Fix: markdown-include regular expression
* Fix: Unable to export to pdf from markdown [#166](https://github.com/yzane/vscode-markdown-pdf/issues/166)
* Fix: python code export err [#178](https://github.com/yzane/vscode-markdown-pdf/issues/178)
* Fix: Add support for Ubuntu and Centos
* Fix: Error: Failed to lanuch chrome! [#97](https://github.com/yzane/vscode-markdown-pdf/issues/97)
* Fix: I failed to launch chrome in WSL [#160](https://github.com/yzane/vscode-markdown-pdf/issues/160)
* Fix: Unable to export to pdf from markdown [#166](https://github.com/yzane/vscode-markdown-pdf/issues/166)


## License
Expand Down
16 changes: 9 additions & 7 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function convertMarkdownToHtml(filename, type, text) {
if (vscode.workspace.getConfiguration('markdown-pdf')['markdown-it-include']['enable']) {
md.use(require("markdown-it-include"), {
root: path.dirname(filename),
includeRe: /\:(?:\[[^\]]*\])?\(([^)]+\.*)\)/i
includeRe: /:\[.+\]\((.+\..+)\)/i
});
}

Expand Down Expand Up @@ -388,15 +388,17 @@ function exportPdf(data, filename, type, uri) {
return;
}

const puppeteer = require('puppeteer');
const puppeteer = require('puppeteer-core');
// create temporary file
var f = path.parse(filename);
var tmpfilename = path.join(f.dir, f.name + '_tmp.html');
exportHtml(data, tmpfilename);
var options = {
executablePath: vscode.workspace.getConfiguration('markdown-pdf')['executablePath'] || puppeteer.executablePath(),
args: ['--lang='+vscode.env.langauage]
};
args: ['--lang='+vscode.env.langauage, '--no-sandbox', '--disable-setuid-sandbox']
// Setting Up Chrome Linux Sandbox
// https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#setting-up-chrome-linux-sandbox
};
const browser = await puppeteer.launch(options);
const page = await browser.newPage();
await page.goto(vscode.Uri.file(tmpfilename).toString(), { waitUntil: 'networkidle0' });
Expand Down Expand Up @@ -767,7 +769,7 @@ function checkPuppeteerBinary() {
}

// bundled Chromium
const puppeteer = require('puppeteer');
const puppeteer = require('puppeteer-core');
executablePath = puppeteer.executablePath();
if (isExistsPath(executablePath)) {
return true;
Expand All @@ -792,9 +794,9 @@ function installChromium() {
setProxy();

var StatusbarMessageTimeout = vscode.workspace.getConfiguration('markdown-pdf')['StatusbarMessageTimeout'];
const puppeteer = require('puppeteer');
const puppeteer = require('puppeteer-core');
const browserFetcher = puppeteer.createBrowserFetcher();
const revision = require(path.join(__dirname, 'node_modules', 'puppeteer', 'package.json')).puppeteer.chromium_revision;
const revision = require(path.join(__dirname, 'node_modules', 'puppeteer-core', 'package.json')).puppeteer.chromium_revision;
const revisionInfo = browserFetcher.revisionInfo(revision);

// download Chromium
Expand Down
135 changes: 83 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 487f22a

Please sign in to comment.