Closed jm-nab closed 3 months ago
These should not happen, it would take us forever to update all of the articles. HTTP response body: {"message":"Body should have a value.","code":"knowledge.variation.empty.request","status":400,"contextId":"8d282438-c708-4777-89c4-f49d1ac094ca","details":[],"errors":[]}
The above error is returned if an empty body is sent in a document variation request. What is the html that you are trying to convert?
HTTP response body: {"message":"Please provide a valid article title","code":"bad.request","status":400,"entityName":"DocumentV2","messageWithParams":"Please provide a valid article title","messageParams":{},"contextId":"bfb5484a-a809-4ebc-b3e2-5de93629c748","details":[],"errors":[]} Example: How To Resolve Word Word/No *WORD Word/WORD File Not Found Error: word, word, word Ideally, the parser would fix, or coerce the title and body to be compliant.
This lib is for converting html to the json structure that can be used in the body property of document variation requests. It is not concerned about document titles. These characters are not allowed in title: ~`^*=|<> Can you just remove/replace them for the document request?
Yes I can write a title transform, however it makes it a bit inconvenient having to write an extra transform layer before going live, just to try the trial of the live agent.
I think it could be argued that the title conversion should be handled by the library, and that it shouldn't be incumbent on the support team, or your customers dev team to know the title is just json, the library which converts and imports it should have the context and know to do that.
I understand the empty body issue, however this actually appears to stem from a bug with the parser, it is failing to parse borderWidth
I added a traceback.
To summarize, there's 2 issues:
1) Title coercion to whatever the api expects ( just json )
2) borderWdith
on tables doesn't work
borderWidth
bug: could you show an example html input?
Yes:
<!DOCTYPE html>
<html>
<head>
<title>Nested Elements Example</title>
</head>
<body>
<h1>This is <i>italic</i> heading</h1>
<p>This is <u>underlined</u> paragraph</p>
<ul>
<li>Beetroot</li>
<li>Ginger</li>
<li>Potato</li>
<li>Radish</li>
</ul>
<img src="https://cdn.com/_/some image with spaces.png">
<p><strong></p>
<!-- righ here -->
<table align="center" border="1" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th style="width: 18.711%; background-color: rgb(239, 239, 239);">Symbol</th>
<th style="width: 50.5198%; background-color: rgb(239, 239, 239);">Keystroke</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 18.711%;" valign="bottom" width="98">
<p align="center">-</p>
</td>
<td style="width: 50.5198%;" valign="top" width="306">
<p>alpha left arrow key</p>
</td>
</tr>
<tr></tr>
</tbody>
</table>
</body>
</html>
Thanks for the html, we will fix this bug.
It's quite limited which properties the converter looks for in the html, it only looks for style attributes. This could be a workaround until the fix: write border="1" style="border: 1px solid"
instead of border="1"
.
This bug is fixed in version 0.3.4, change: https://github.com/MyPureCloud/knowledge-html-converter/commit/5ad2d11fe5a6ac78e787fb0ec6cf96861517c33f
> HTTP response body: {"message":"Body should have a value.","code":"knowledge.variation.empty.request","status":400,"contextId":"8d282438-c708-4777-89c4-f49d1ac094ca","details":[],"errors":[]}And:
Example:
How To Resolve Word Word/No *WORD Word/WORD File Not Found Error: word, word, word
Ideally, the parser would fix, or coerce the title
and body to be compliant.Or actually it appears what might be happening is this: