API が MarkDown テーブルを受け付けない

ホスト型ソリューションを使用しています。

問題の説明: API を使用して投稿を作成しています。これは過去 4 ヶ月間(直近は 2019 年 3 月 11 日月曜日)まで完璧に機能していましたが、今日まで機能していました。問題を特定するために、いくつかの非常に簡単なテストを作成しました。

API を通して送信されるデータ:

Col1 Col2
Col1data Col2data

結果の画像:

ハイライトされた最初のヘッダーとデータの区切り線に注目してください。何らかの原因で、3 つのダッシュから完全な線に変更されてしまいました。2 番目の区切り線は変更されていません。これが問題だと考えています。最初の列の区切り線が 3 つのダッシュではなくなったため、Markdown テーブルとして解釈されなくなっているのです。なぜ 3 つのダッシュがこのライン文字(複数)に変更されるのかはわかりません。

手動で投稿する際にも、この「ダッシュからラインへの変更」を(ある程度)再現できます。以下を入力すると(2 番目の列の区切り線は 3 つのダッシュです)…投稿されるまではその通りですが…
|Col1|Col2|
|___|—|
|Col1data|Col2data|

投稿すると、実際には 2 番目の区切り線が完全な線として表示されます。このサイトの新規ユーザーのため、画像を 2 枚以上投稿できないと言われているのですが(え?)、正確な画像を示すことはできませんが、テスト用 URL はこちらです: https://try.discourse.org/t/test-table-cause-seeing-problem/1335

ダッシュをライン文字に変更させる原因が、API における 3 つのダッシュの変更にも影響を与えていると考えています。ただし、これはあくまで推測です。

どなたか、この問題について何か手がかりを提供していただけないでしょうか?1) なぜこのようなことが起きているのか?2) 最近、これが原因となるような変更があったのか?

Try disabling the setting enable markdown typographer

「いいね!」 1

Thanks for the quick reply Rafael. That definitely got back the 3 dashes, but it still displays as plain text, instead of converting it to a table, like I would expect. So, quite possibly, what I thought was the issue was not :-(. Any other suggestions as to why this may not be displaying correctly as a table after posting thru the API?

image

Can you share the exact content of the post sent to the API here?

Not really - it’s a a PS script…the first line tho shows the data being passed in, and the result shown above…

 $HTMLTableAll = '|Col1|Col2|<br>|---|---|<br>|Col1data|Col2data|'

#Create Discourse JSON Body for posting new Topic
$DiscourseBodyJSON = @{}
$DiscourseBodyJSON.Add("title","Test - please ignore")
$DiscourseBodyJSON.Add("raw",$HTMLTableAll)
$DiscourseBodyJSON.Add("category",$TFOCategoryID)
$DiscourseDevNoteJSON = $DiscourseBodyJSON | ConvertTo-Json
$URI = $TWDomain + "posts.json" + $DiscourseCredsURI

Show-Log -LogType Txt -LogText $URI
Show-Log -LogType Txt -LogText $HTMLTableAll

$PostNote = @{Method     = 'POST'
             Uri         = $URI  
             ContentType = "application/json"
             Headers     = @{Authorization = "Basic " + [System.Convert]::ToBase64String($DiscourseUserEnc)}
             Body        = $DiscourseDevNoteJSON
            }

Result:

Actually, I have this working again. I think that settings change actually did fix this issue. Thanks for the help!

Only thing that jumps to me is that we use \n for line breaks in the API instead of <br>.

Anyway, since it’s working already, keep going.

「いいね!」 4