Skip to content

Commit

Permalink
markdown parsing on insertion only
Browse files Browse the repository at this point in the history
  • Loading branch information
moinism committed Jul 2, 2017
1 parent cff977c commit 1ed9849
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build/botui-theme-default.css

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

10 changes: 6 additions & 4 deletions build/botui.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* botui 0.1.2
* botui 0.1.4
* A JS library to build the UI for your bot
* https://botui.moin.im
*
Expand Down Expand Up @@ -141,9 +141,11 @@
}
};

root.Vue.directive('botui-markdown', function (el, binding) {
if(binding.value == 'false') return;
el.innerHTML = _parseMarkDown(el.textContent);
root.Vue.directive('botui-markdown', {
inserted: function (el, binding) {
if(binding.value == 'false') return;
el.innerHTML = _parseMarkDown(el.textContent);
}
});

root.Vue.directive('botui-scroll', {
Expand Down
4 changes: 2 additions & 2 deletions build/botui.min.css

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

4 changes: 2 additions & 2 deletions build/botui.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "botui",
"version": "0.1.3",
"version": "0.1.4",
"description": "A JS library to build the UI for your bot",
"main": "build/botui.min.js",
"devDependencies": {
Expand Down
8 changes: 5 additions & 3 deletions src/scripts/botui.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@
}
};

root.Vue.directive('botui-markdown', function (el, binding) {
if(binding.value == 'false') return;
el.innerHTML = _parseMarkDown(el.textContent);
root.Vue.directive('botui-markdown', {
inserted: function (el, binding) {
if(binding.value == 'false') return;
el.innerHTML = _parseMarkDown(el.textContent);
}
});

root.Vue.directive('botui-scroll', {
Expand Down
1 change: 1 addition & 0 deletions src/styles/botui.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

.botui-message-content {
width: auto;
max-width: 85%;
display: inline-block;

&.human {
Expand Down
4 changes: 4 additions & 0 deletions src/styles/themes/default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ $primary-color: #919292;
background-color: $primary-color;
}

&.text {
line-height: 1.3;
}

&.embed {
padding: 5px;
border-radius: 5px;
Expand Down

0 comments on commit 1ed9849

Please sign in to comment.