[BotBuilder-AI] Remove 'html-entities' from QnA Maker class #909
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
html-entities
library and its decoding from the answer formatting.Specific Changes
At this moment when the QnA Maker class in BotBuilder AI receives an answer that contains enconded HTML entities, said entities are decoded before returning the answer.
Remove this behaviour from the QnA Maker answer formatting, as this responsibility should be delegated to the user consuming the answer.
Testing
We did a couple of tests using both the NodeJS and .NET version of the class.
A knowledge base was created with a single answer containing several encoded HTML entities.
We tested the answer from the knowledge base by adding it to a
console.log()
and thesendActivity()
using the Echo Browser bot sample.As seen in the image above, the answer returned by the QnA Maker class does not match the answer stored in the knowledge base.
We also compared the behaviour of the JavaScript class against the .NET class replicating the same test.
This test confirms that the behaviour of the QnA Maker class in .NET does not decode the HTML entities before returning the answer.