mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 20:15:46 +08:00
812e0d6b5e
* ensure emails don't have spaces * import banned users as suspended for 1k yrs * upgrade users to TL2 if they have comments * topic: import views, closed and pinned info * import messages * encode vanilla usernames for permalinks. Vanilla usernames can contain spaces and special characters. * parse Vanilla's new rich body format
171 lines
5.1 KiB
JSON
171 lines
5.1 KiB
JSON
{
|
|
"text": [{
|
|
"insert": "This is a message.\nAnd a second line.\n"
|
|
}],
|
|
"mention": [
|
|
{ "insert": { "mention": { "name": "Gandalf The Grey", "userID": 666 } } },
|
|
{
|
|
"insert": ", what do you think?\n"
|
|
}
|
|
],
|
|
"links": [
|
|
{
|
|
"insert": "We can link to the "
|
|
},
|
|
{
|
|
"attributes": { "link": "https:\/\/www.discourse.org\/" },
|
|
"insert": "Discourse home page"
|
|
},
|
|
{
|
|
"insert": " and it works."
|
|
}
|
|
],
|
|
"quote": [
|
|
{
|
|
"insert": {
|
|
"embed-external": {
|
|
"data": {
|
|
"recordID": 12345,
|
|
"recordType": "discussion",
|
|
"body": "This is the full<br \/>body<br \/>of the quoted discussion.<br \/>",
|
|
"bodyRaw": "This is the full\r\nbody\r\nof the quoted discussion.\r\n",
|
|
"format": "Html",
|
|
"dateInserted": "2020-04-27T15:32:12+00:00",
|
|
"insertUser": {
|
|
"userID": 34567,
|
|
"name": "Saruman",
|
|
"photoUrl": "\/\/w1.vanillicon.com\/v2\/117aa212e39e806eed30886df18fe9bc.svg",
|
|
"dateLastActive": "2020-05-03T01:08:18+00:00"
|
|
},
|
|
"displayOptions": {
|
|
"showUserLabel": false,
|
|
"showCompactUserInfo": true,
|
|
"showDiscussionLink": true,
|
|
"showPostLink": true,
|
|
"showCategoryLink": false,
|
|
"renderFullContent": false,
|
|
"expandByDefault": false
|
|
},
|
|
"url": "https:\/\/vanilla.sampleforum.org\/discussion\/12345\/the-discussion-title",
|
|
"embedType": "quote",
|
|
"name": "The discussion title"
|
|
},
|
|
"loaderData": {
|
|
"type": "link",
|
|
"link": "https:\/\/vanilla.sampleforum.org\/discussion\/12345\/the-discussion-title"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{ "insert": "When did this happen?\n" }
|
|
],
|
|
"image": [
|
|
{
|
|
"insert": "Here's the screenshot:\n"
|
|
},
|
|
{
|
|
"insert": {
|
|
"embed-external": {
|
|
"data": {
|
|
"url": "https:\/\/vanilla.sampleforum.org\/uploads\/569\/ZSM5T09U03WE.png",
|
|
"name": "Screen Shot 2020-05-26 at 7.09.06 AM.png",
|
|
"type": "image\/png",
|
|
"size": 94050,
|
|
"width": 1214,
|
|
"height": 886,
|
|
"mediaID": 22,
|
|
"dateInserted": "2020-05-26T11:11:29+00:00",
|
|
"insertUserID": 12345,
|
|
"foreignType": "embed",
|
|
"foreignID": 12345,
|
|
"embedType": "image",
|
|
"format": null,
|
|
"bodyRaw": null
|
|
},
|
|
"loaderData": { "type": "image" }
|
|
}
|
|
}
|
|
},
|
|
{ "insert": "\n" }
|
|
],
|
|
"embed_link": [
|
|
{
|
|
"insert": "Does anyone know this website?\n"
|
|
},
|
|
{
|
|
"insert": {
|
|
"embed-external": {
|
|
"data": {
|
|
"body": "A preview text of the url fetched by Vanilla Forum.",
|
|
"photoUrl": "https:\/\/someurl.com\/an_image.jpeg",
|
|
"url": "https:\/\/someurl.com\/long\/path\/here_and_there\/?fdkmlgm",
|
|
"embedType": "link",
|
|
"name": "Title of the page being linked",
|
|
"format": null,
|
|
"bodyRaw": null
|
|
},
|
|
"loaderData": {
|
|
"type": "link",
|
|
"link": "https:\/\/someurl.com\/long\/path\/here_and_there\/?fdkmlgm"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{ "insert": "\n\n" }
|
|
],
|
|
"upload_file": [
|
|
{
|
|
"insert": "This is a PDF I've uploaded:\n"
|
|
},
|
|
{
|
|
"insert": {
|
|
"embed-external": {
|
|
"data": {
|
|
"url": "https:\/\/vanilla.sampleforum.org\/uploads\/393\/5QR3BX57K7HM.pdf",
|
|
"name": "original_name_of_file.pdf",
|
|
"type": "application\/pdf",
|
|
"size": 501287,
|
|
"mediaID": 9,
|
|
"dateInserted": "2020-05-21T17:58:07+00:00",
|
|
"insertUserID": 12345,
|
|
"foreignType": "embed",
|
|
"foreignID": 12345,
|
|
"embedType": "file",
|
|
"format": null,
|
|
"bodyRaw": null
|
|
},
|
|
"loaderData": {
|
|
"type": "file",
|
|
"file": [],
|
|
"progressEventEmitter": {
|
|
"listeners": [null]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{ "insert": "\n" }
|
|
],
|
|
"complex_formatting": [
|
|
{ "attributes": { "bold": true }, "insert": "Name" },
|
|
{ "insert": ": Jon Snow\n" },
|
|
{ "attributes": { "bold": true, "italic": true }, "insert": "* not their real name" },
|
|
{ "insert": "\n" },
|
|
{ "insert": "first item" },
|
|
{ "attributes": { "list": { "depth": 0, "type": "ordered" } }, "insert": "\n" },
|
|
{ "insert": "second" },
|
|
{ "attributes": { "list": { "depth": 0, "type": "ordered" } }, "insert": "\n" },
|
|
{ "insert": "third and last" },
|
|
{ "attributes": { "list": { "depth": 0, "type": "ordered" } }, "insert": "\n" },
|
|
{ "insert": "That's all folks!\n" }
|
|
],
|
|
"code_block": [
|
|
{ "insert": "Here's a monospaced block:" },
|
|
{ "insert": "this line should be monospaced" },
|
|
{ "attributes": { "code-block": true }, "insert": "\n" },
|
|
{ "insert": "this one too, with extra spaces " },
|
|
{ "attributes": { "code-block": true }, "insert": "\n" },
|
|
{ "insert": "but not this one" }
|
|
]
|
|
}
|