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, InEmbedAddressBegin,
InEmbedAddressEnd, InEmbedAddressEnd,
InLineBreak, InLineBreak,
InLineBreak1,
InLineBreak2,
}; };
let state = State.InText; let state = State.InText;
let currentImage = ''; let currentImage = '';
@ -175,12 +177,26 @@ export class GBConversationalService implements IGBConversationalService {
state = State.InLineBreak; state = State.InLineBreak;
} }
else { else {
state = State.InText;
currentText = currentText.concat(c); currentText = currentText.concat(c);
} }
break; break;
case State.InLineBreak: case State.InLineBreak:
if (c === '\n') { if (c === '\n') {
if (currentText !== '') { 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) { if (mobile === null) {
await step.context.sendActivity(currentText); await step.context.sendActivity(currentText);
} }
@ -188,10 +204,18 @@ export class GBConversationalService implements IGBConversationalService {
this.sendToMobile(min, mobile, currentText); this.sendToMobile(min, mobile, currentText);
} }
await sleep(3000); await sleep(3000);
}
currentText = ''; currentText = '';
state = State.InText; state = State.InText;
} }
else if (c === '!') {
state = State.InImageBegin;
}
else if (c === '[') {
state = State.InEmbedBegin;
} else {
currentText = currentText.concat('\n', '\n', c);
state = State.InText;
}
break; break;
case State.InEmbedBegin: case State.InEmbedBegin:
if (c === '=') { if (c === '=') {

View file

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