Skip to content

Commit b802518

Browse files
committed
fixed issue with appears entities when we are editing or previewing a post. Added better support for Github's gists (now used github-gist web component from Polymer library). Added support for Polymer's web components in general.
1 parent 94981be commit b802518

39 files changed

+7933
-27
lines changed

.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "/static/bower_components"
3+
}

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pass:demo
1717
- [jQuery](http://jquery.com)
1818
- [Lightbox 2](https://github.com/lokesh/lightbox2)
1919
- [Markdown](http://daringfireball.net/projects/markdown/syntax)
20+
- [Polymer](http://www.polymer-project.org)
2021

2122

2223
# What it can:
@@ -106,13 +107,13 @@ To insert any tag you need to SELECT a word and then click on a needed tag on th
106107

107108
You can insert github [Gists](https://gist.github.com/).
108109

109-
For this type a word in the editor, select it like you did when you added a tag from the panel, copy the embed gist link from the github gists page and paste it to the dialog window.
110+
For this click on the Gist tag on the panel, copy the gist id from the github gists page and paste it to the dialog window.
110111

111112
The word will be replaced with a working gist tag.
112113

113-
![gist_page](http://i.imgur.com/Zagr8Uv.png)
114+
![gist_page](http://i.imgur.com/1hQKsaX.png)
114115

115-
![inser_gist](http://i.imgur.com/nqS4Isz.png)
116+
![inser_gist](http://i.imgur.com/x5Yb9es.png)
116117

117118
~~To insert an image you also need to select a word that will be used like a title attribute and paste the image URL into the dialog window.~~
118119

bower.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "flask_blog",
3+
"version": "0.0.0",
4+
"authors": [
5+
"Dmitry Maslov <maslov.dmitrij@gmail.com>"
6+
],
7+
"license": "MIT",
8+
"private": true,
9+
"ignore": [
10+
"**/.*",
11+
"node_modules",
12+
"bower_components",
13+
"test",
14+
"tests"
15+
],
16+
"devDependencies": {
17+
"github-gist": "~0.1.1"
18+
}
19+
}

mdx_github_gists.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
55

66
class GitHubGistExtension(Extension):
77
def extendMarkdown(self, md, md_globals):
8-
RE = r'\[gist\](\w+\W+.+)\[\/gist\]'
8+
RE = r'\[gist\](\w+)\[\/gist\]'
99
gistPattern = GitHubGist(RE)
10-
md.inlinePatterns.add('script', gistPattern, ">not_strong")
10+
md.inlinePatterns.add('github-gist', gistPattern, ">not_strong")
1111

1212

1313
class GitHubGist(Pattern):
1414
def handleMatch(self, m):
15-
src = m.group(2).strip()
16-
if src:
17-
script = etree.Element('script')
18-
script.set('src', src)
15+
gistid_value = m.group(2).strip()
16+
if gistid_value:
17+
element = etree.Element('github-gist')
18+
element.set('gistid', gistid_value)
1919
else:
20-
script = ''
21-
return script
20+
element = ''
21+
22+
return element
2223

2324

2425
def makeExtension(configs=None):
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "core-component-page",
3+
"private": true,
4+
"dependencies": {
5+
"platform": "Polymer/platform#>=0.3.0 <1.0.0",
6+
"polymer": "Polymer/polymer#>=0.3.0 <1.0.0"
7+
},
8+
"homepage": "https://github.com/Polymer/core-component-page",
9+
"version": "0.3.5",
10+
"_release": "0.3.5",
11+
"_resolution": {
12+
"type": "version",
13+
"tag": "0.3.5",
14+
"commit": "87617aa1282994eecf5f1f57ef149155ed96f7f1"
15+
},
16+
"_source": "git://github.com/Polymer/core-component-page.git",
17+
"_target": ">=0.3.0 <1.0.0",
18+
"_originalSource": "Polymer/core-component-page"
19+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
core-component-page
2+
===================
3+
4+
See the [component page](http://polymer-project.org/docs/elements/core-elements.html#core-component-page) for more information.
5+
6+
Note: this is the vulcanized version of [`core-component-page-dev`](https://github.com/Polymer/core-component-page-dev) (the source).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "core-component-page",
3+
"private": true,
4+
"dependencies": {
5+
"platform": "Polymer/platform#>=0.3.0 <1.0.0",
6+
"polymer": "Polymer/polymer#>=0.3.0 <1.0.0"
7+
}
8+
}

0 commit comments

Comments
 (0)