Skip to content

Commit 56ab07d

Browse files
authored
Merge pull request #16 from denco/0.1.7
0.1.7
2 parents e004197 + 3a855c1 commit 56ab07d

24 files changed

+157
-98
lines changed

CHANGELOG.md

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,58 @@
11
# Confluence Wiki Markup
22

3-
## 0.1.6
4-
* fix using css and render of emoticons rendering `Content-Security-Policy`
5-
* skip render empty lines
6-
* extend documentation
7-
* merge [Improvement to CSS + Ability to Change Monospace Font for Preview](https://github.com/denco/vscode-confluence-markup/pull/14), thanks to [macintacos](https://github.com/macintacos) for contributing:
8-
* Add configuration property: `confluenceMarkup.monospaceFont` for monospace font, default: `Menlo, Monaco, Consolas, monospace`
9-
* wrap all tags with paragraf
3+
## [0.1.7](https://github.com/denco/vscode-confluence-markup/releases/tag/0.1.7)
104

11-
## 0.1.5
12-
* use webview api for rendering in vscode 1.33.x
13-
* refactor confluence snippets
14-
* new logo
15-
* preview unsaved files
5+
- fix skip empty lines
6+
- extend content security policy for inline styles
7+
- enhance testing
168

17-
## 0.1.4
18-
* fix [List indenting @win](https://github.com/denco/vscode-confluence-markup/issues/6)
19-
* restructure
20-
* win/nix test files
9+
## [0.1.6](https://github.com/denco/vscode-confluence-markup/releases/tag/0.1.6)
2110

22-
## 0.1.3
11+
- fix using css and render of emoticons rendering `Content-Security-Policy`
12+
- skip render empty lines
13+
- extend documentation
14+
- merge [Improvement to CSS + Ability to Change Monospace Font for Preview](https://github.com/denco/vscode-confluence-markup/pull/14), thanks to [macintacos](https://github.com/macintacos) for contributing:
15+
- Add configuration property: `confluenceMarkup.monospaceFont` for monospace font, default: `Menlo, Monaco, Consolas, monospace`
16+
- wrap all tags with paragraf
2317

24-
* fix [nested lists](https://github.com/denco/vscode-confluence-markup/issues/7)
25-
* fix [headless table](https://github.com/denco/vscode-confluence-markup/issues/5)
26-
* rendering tables with row headers
18+
## [0.1.5](https://github.com/denco/vscode-confluence-markup/releases/tag/0.1.5)
2719

28-
## 0.1.2
20+
- use webview api for rendering in vscode 1.33.x
21+
- refactor confluence snippets
22+
- new logo
23+
- preview unsaved files
2924

30-
* fix rendering of tag inside of code macro
31-
* fix [noformat issue](https://github.com/denco/vscode-confluence-markup/issues/3)
32-
* fix strikethrough and italic text
33-
* add table rendering
25+
## [0.1.4](https://github.com/denco/vscode-confluence-markup/releases/tag/0.1.4)
3426

35-
## 0.1.1
27+
- fix [List indenting @win](https://github.com/denco/vscode-confluence-markup/issues/6)
28+
- restructure
29+
- win/nix test files
3630

37-
* fix simple link
38-
* fix keyboard shorcuts, activate only for confluence language id
39-
* add simple css
31+
## [0.1.3](https://github.com/denco/vscode-confluence-markup/releases/tag/0.1.3)
4032

41-
## 0.1.0
33+
- fix [nested lists](https://github.com/denco/vscode-confluence-markup/issues/7)
34+
- fix [headless table](https://github.com/denco/vscode-confluence-markup/issues/5)
35+
- rendering tables with row headers
4236

43-
* add preview action
44-
* add support for confluence emoticons
45-
* change language id from: confluence-markup to confluence
37+
## [0.1.2](https://github.com/denco/vscode-confluence-markup/releases/tag/0.1.2)
4638

47-
## 0.0.1 - First Release
39+
- fix rendering of tag inside of code macro
40+
- fix [noformat issue](https://github.com/denco/vscode-confluence-markup/issues/3)
41+
- fix strikethrough and italic text
42+
- add table rendering
4843

49-
* convert Textmate bundle to Visual Studio Code format.
44+
## [0.1.1](https://github.com/denco/vscode-confluence-markup/releases/tag/0.1.1)
45+
46+
- fix simple link
47+
- fix keyboard shorcuts, activate only for confluence language id
48+
- add simple css
49+
50+
## [0.1.0](https://github.com/denco/vscode-confluence-markup/releases/tag/0.1.0)
51+
52+
- add preview action
53+
- add support for confluence emoticons
54+
- change language id from: confluence-markup to confluence
55+
56+
## [0.0.1](https://github.com/denco/vscode-confluence-markup/releases/tag/0.0.1) - First Release
57+
58+
- convert Textmate bundle to Visual Studio Code format.

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,42 @@
66
[![Rating](https://vsmarketplacebadge.apphb.com/rating-short/denco.confluence-markup.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=denco.confluence-markup)
77

88
## Description
9-
Provide preview for Confluence Markup while editing them in VSCode
109

11-
Adds syntax highlighting, snippets and preview for Confluence® Wiki files in Visual Studio Code.
10+
Provide preview for Confluence® and Jira® Markup while editing them in Visual Studio Code.
11+
12+
Provide syntax highlighting and snippets.
1213

1314
## Supported file extentions
15+
1416
LanguageID: `confluence`
1517

1618
Defaulft supported file extentions:
19+
1720
- `.confluence`
1821
- `.wiki`
1922
- `.jira`
2023
- `.markup`
2124

2225
The extension can be activated in two ways
2326

24-
* Toggle Preview
25-
* Linux & Windows: `ctrl+shift+v`
26-
* MAC: `cmd+shift+v` or `ctrl+shift+v`
27-
* Open|Close Preview to the Side
28-
* Linux & Windows: `ctrl+k v`
29-
* MAC: `cmd+k v` or `ctrl+k v`
27+
- Toggle Preview
28+
- Linux & Windows: `ctrl+shift+v`
29+
- MAC: `cmd+shift+v` or `ctrl+shift+v`
30+
- Open|Close Preview to the Side
31+
- Linux & Windows: `ctrl+k v`
32+
- MAC: `cmd+k v` or `ctrl+k v`
3033

3134
## Configuration properties
32-
* *confluenceMarkup.monospaceFont* = `Menlo, Monaco, Consolas, monospace`
3335

36+
- `confluenceMarkup.monospaceFont` = `Menlo, Monaco, Consolas, monospace`
3437

3538
## Confluence documentation
36-
* [Wiki MarkUp](https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html)
37-
* [Storage Format](https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html)
39+
40+
- [MarkUp](https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html)
41+
- [Storage Format](https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html)
3842

3943
Originally syntax from the [Confluence® Textmate Bundle](https://github.com/alkemist/Confluence.tmbundle).
4044

4145
----
4246

43-
> Confluence® is registered trademark owned by [Atlassian](https://www.atlassian.com/)
47+
> Confluence® and Jira® is registered trademark owned by [Atlassian](https://www.atlassian.com/)

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "confluence-markup",
33
"displayName": "Confluence markup",
4-
"version": "0.1.6",
4+
"version": "0.1.7",
55
"publisher": "denco",
66
"description": "Confluence markup language support for Visual Studio Code",
77
"keywords": [
@@ -125,19 +125,19 @@
125125
"compile": "tsc -p ./",
126126
"watch": "tsc -watch -p ./",
127127
"postinstall": "node ./node_modules/vscode/bin/install",
128-
"test": "npm run compile && node ./node_modules/vscode/bin/test",
128+
"test": "npm run clean && npm run compile && node ./node_modules/vscode/bin/test",
129129
"package": "./node_modules/.bin/vsce package",
130-
"clean": "rm -rfv ./out",
131-
"clean-all": "rm ./confluence-markup*.vsix; rm -rf ./.vscode-test; rm -rfv ./out; rm -rfv ./node_modules"
130+
"clean": "rm -rf ./out",
131+
"clean-all": "rm -f ./confluence-markup*.vsix; rm -rf ./.vscode-test; rm -rf ./out; rm -rf ./node_modules"
132132
},
133133
"devDependencies": {
134-
"@types/mocha": "^5.2.6",
134+
"@types/mocha": "^5.2.7",
135135
"@types/node": "^11.13.9",
136136
"eslint": "^5.16.0",
137-
"tslint": "^5.16.0",
138-
"typescript": "^3.3.0",
137+
"tslint": "^5.18.0",
138+
"typescript": "^3.5.3",
139139
"vsce": "^1.66.0",
140-
"vscode": "^1.1.23"
140+
"vscode": "^1.1.36"
141141
},
142142
"__metadata": {
143143
"publisherDisplayName": "denco"

src/ConfluenceContentProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class ConfluenceContentProvider implements vscode.TextDocumentContentProv
5151
<html>
5252
<head>
5353
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
54-
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src vscode-resource: https:; script-src vscode-resource:; style-src vscode-resource:;"/>
54+
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'self' 'unsafe-inline'; img-src vscode-resource: https:; script-src vscode-resource:; style-src vscode-resource:;"/>
5555
<link rel="stylesheet" href="${cssLink}">
5656
</head>
5757
<body>

src/markupParser.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) {
4545
var result = '';
4646
let listTag = '';
4747
let listStyle = '';
48-
let codeTagFlag = 0;
48+
let codeTagFlag = false;
4949
let tableFlag = false;
5050
let listFlag = false;
5151
let listArr: string[] = [];
@@ -54,11 +54,15 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) {
5454
let tag = entry;
5555
let html_tag = false;
5656

57-
if (tag.length === 0 ) {
57+
if ((tag.length === 0 )
58+
&& (! listFlag)
59+
&& (! tableFlag)
60+
&& (! codeTagFlag)
61+
) {
5862
continue;
5963
}
6064

61-
if (codeTagFlag == 0) {
65+
if (! codeTagFlag) {
6266
tag = tag.replace(/h(\d+)\.\s([^\n]+)/g, "<h$1>$2</h$1>");
6367

6468
// tag = tag.replace(/_([^_]*)_/g, "<em>$1</em>");
@@ -75,14 +79,14 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) {
7579

7680
tag = tag.replace(/:\)/g, '<img alt="(smile)" src="' + emoticonUri('smile.png') + '"/>');
7781
tag = tag.replace(/:\(/g, '<img alt="(sad)" src="' + emoticonUri('sad.png') + '"/>');
78-
tag = tag.replace(/:P/g, '<img alt="(cheeky)" src="' + emoticonUri('tongue.png') + '"/>');
82+
tag = tag.replace(/:P/g, '<img alt="(cheeky)" src="' + emoticonUri('cheeky.png') + '"/>');
7983
tag = tag.replace(/:D/g, '<img alt="(laugh)" src="' + emoticonUri('biggrin.png') + '"/>');
8084
tag = tag.replace(/;\)/g, '<img alt="(wink)" src="' + emoticonUri('wink.png') + '"/>');
81-
tag = tag.replace(/\(y\)/g, '<img alt="(thumbs-up)" src="' + emoticonUri('thumbs_up.png') + '"/>');
82-
tag = tag.replace(/\(n\)/g, '<img alt="(thumbs-down)" src="' + emoticonUri('thumbs_down.png') + '"/>');
85+
tag = tag.replace(/\(y\)/g, '<img alt="(thumbs-up)" src="' + emoticonUri('thumbs-up.png') + '"/>');
86+
tag = tag.replace(/\(n\)/g, '<img alt="(thumbs-down)" src="' + emoticonUri('thumbs-down.png') + '"/>');
8387
tag = tag.replace(/\(i\)/g, '<img alt="(information)" src="' + emoticonUri('information.png') + '"/>');
84-
tag = tag.replace(/\(\/\)/g, '<img alt="(tick)" src="' + emoticonUri('check.png') + '"/>');
85-
tag = tag.replace(/\(x\)/g, '<img alt="(cross)" src="' + emoticonUri('error.png') + '"/>');
88+
tag = tag.replace(/\(\/\)/g, '<img alt="(tick)" src="' + emoticonUri('tick.png') + '"/>');
89+
tag = tag.replace(/\(x\)/g, '<img alt="(cross)" src="' + emoticonUri('cross.png') + '"/>');
8690
tag = tag.replace(/\(!\)/g, '<img alt="(warning)" src="' + emoticonUri('warning.png') + '"/>');
8791

8892
tag = tag.replace(/\\\\/gi, '<br/>');
@@ -133,16 +137,16 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) {
133137
let re = /\{[(code)|(noformat)].*\}/;
134138
let match = tag.match(re);
135139
if (match) {
136-
if (codeTagFlag === 0) {
140+
if (! codeTagFlag) {
137141
tag = `<pre><code style='font-family: ${MONOSPACE_FONT_FAMILY}'>`;
138-
codeTagFlag = 1;
142+
codeTagFlag = true;
139143
} else {
140144
tag = '</pre></code>';
141-
codeTagFlag = 0;
145+
codeTagFlag = false;
142146
}
143147
}
144148

145-
if (codeTagFlag === 0) {
149+
if (! codeTagFlag) {
146150
// lists
147151
re = /^([-|\*|#]+)\s(.*)/;
148152
match = tag.match(re);

0 commit comments

Comments
 (0)