Skip to content

Commit

Permalink
add license in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
madneal committed Jun 9, 2017
1 parent c74434c commit 88ed8c2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# export-medium
A Chrome extension to export the story in Medium to a markdown format file.

## LICENSE

[MIT](https://github.com/neal1991/export-medium/blob/master/LICENSE)
24 changes: 13 additions & 11 deletions scripts/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// })
let mainDiv = document.querySelector('.main')
const loadIcon = document.querySelector('.load')
const exportBtn = document.querySelector('.export')

document.querySelector('.export').addEventListener('click', function () {
createLoadForm()
Expand Down Expand Up @@ -137,16 +138,16 @@ function processParagraph (p) {
markup = '\n'
break
case 2:
p.text = '\n # ' + p.text.replace(/\n/g, '\n #') + ' \n'
p.text = '# ' + p.text.replace(/\n/g, '\n #') + ' \n'
break
case 3:
p.text = '\n \n ## ' + p.text.replace(/\n/g, '\n ##') + ' \n'
p.text = '## ' + p.text.replace(/\n/g, '\n ##') + ' \n'
break
case 4: // image and caption
const imageWidth = parseInt(p.metadata.originalWidth, 10)
const imageSrc = MEDIUM_IMG_CDN + Math.max(imageWidth * 2, 2000) + '/' + p.metadata
.id
p.text = '\n ![' + p.text + '](' + imageSrc + ')' + ' \n'
p.text = '![' + p.text + '](' + imageSrc + ')' + ' \n'
break
case 6:
markup = '> '
Expand Down Expand Up @@ -222,17 +223,18 @@ function createMarkupsArray (markups) {

function copyToClipboard(input) {
const el = document.createElement('textarea');
el.value = input;

el.setAttribute('readonly', '');
el.style.contain = 'strict';
el.style.all = 'unset';
el.style.position = 'absolute';
el.style.left = '-9999px';
el.style.fontSize = '12pt';
el.style.fontsize = '12pt'
el.style.border = '0'
el.style.padding = '0'
el.style.margin = '0'
el.style.position = 'absolute'
el.style.left = '-9999px'
el.setAttribute('readonly', '')
el.value = input

document.body.appendChild(el)
select(el)
el.select()

let success = false;
try {
Expand Down

0 comments on commit 88ed8c2

Please sign in to comment.