fix(core.gbapp): Fix in undeploy and markdown processsing.

This commit is contained in:
Rodrigo Rodriguez 2020-04-03 02:50:33 -03:00
parent 134cf31695
commit b477c46d9c
2 changed files with 38 additions and 14 deletions

View file

@ -151,6 +151,8 @@ export class GBConversationalService implements IGBConversationalService {
InEmbedAddressBegin,
InEmbedAddressEnd,
InLineBreak,
InLineBreak1,
InLineBreak2,
};
let state = State.InText;
let currentImage = '';
@ -164,35 +166,57 @@ export class GBConversationalService implements IGBConversationalService {
switch (state) {
case State.InText:
if (c === '!') {
state = State.InImageBegin;
}
else if (c === '[') {
state = State.InEmbedBegin;
}
else if (c === '\n') {
else if (c === '\n') {
state = State.InLineBreak;
}
else {
state = State.InText;
currentText = currentText.concat(c);
}
break;
case State.InLineBreak:
if (c === '\n') {
if (currentText !== '') {
if (mobile === null) {
await step.context.sendActivity(currentText);
}
else {
this.sendToMobile(min, mobile, currentText);
}
await sleep(3000);
state = State.InLineBreak1;
}
else if (c === '!') {
state = State.InImageBegin;
}
else if (c === '[') {
state = State.InEmbedBegin;
} else {
currentText = currentText.concat('\n', c);
state = State.InText;
}
break;
case State.InLineBreak1:
if (c === '\n') {
if (mobile === null) {
await step.context.sendActivity(currentText);
}
else {
this.sendToMobile(min, mobile, currentText);
}
await sleep(3000);
currentText = '';
state = State.InText;
}
break;
else if (c === '!') {
state = State.InImageBegin;
}
else if (c === '[') {
state = State.InEmbedBegin;
} else {
currentText = currentText.concat('\n', '\n', c);
state = State.InText;
}
break;
case State.InEmbedBegin:
if (c === '=') {
if (currentText !== '') {
@ -207,7 +231,7 @@ export class GBConversationalService implements IGBConversationalService {
currentText = '';
state = State.InEmbedAddressBegin;
}
break;
case State.InEmbedAddressBegin:
if (c === ']') {
@ -217,7 +241,7 @@ export class GBConversationalService implements IGBConversationalService {
await sleep(5000);
currentEmbedUrl = '';
}
else{
else {
currentEmbedUrl = currentEmbedUrl.concat(c);
}
break;

View file

@ -338,7 +338,7 @@ export class GBDeployer implements IGBDeployer {
case '.gbkb':
const service = new KBService(this.core.sequelize);
return service.undeployKbFromStorage(instance, this, p.packageId);
return await service.undeployKbFromStorage(instance, this, p.packageId);
case '.gbui':