استعادة البيانات "الخام" الحقيقية التي أنشأت منشورًا؟

If you’re using chrome desktop then you can use Ctrl+Shift+V to paste as plain text instead of notepad.

Also in the admin site settings page, you can disable this fancy pasting behavior by unchecking the “enable rich text paste” option.

إعجابَين (2)

Thanks, but my goal is to keep the original formatting from microsoft word (in the raw data), not strip it down to plain text.

Currently, Discourse removes a variety of the formatting–such as font size and font type, while leaving others (bold and italics seem to stay there). As a comparison, Gmail composer seems to leave all formatting.

To try to keep more formatting, I suppose an alternative would be to upload a word document (not paste in text to the composer–but upload the actual doc). The problem there, I think, is that discourse does not show the contents of the upload inline (it just displays an upload link).

Then paste the raw HTML.

There are different goals involved. Gmail’s goal is to preserve all the formatting, whereas a forum’s goal is to keep a meaningful subset of it while preventing abuse (huge text, blinking text, OVERLY LARGE FONTS, annoying colours, etc.)

As a simple example, here is some simple text’s HTML as generated by Office, present in the clipboard as text/html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
	<title></title>
	<meta name="generator" content="LibreOffice 7.1.2.2 (Linux)"/>
	<style type="text/css">
		@page { size: 21.59cm 27.94cm; margin: 2cm }
		p { margin-bottom: 0.25cm; line-height: 115%; background: transparent }
	</style>
</head>
<body lang="en-CA" link="#000080" vlink="#800000" dir="ltr"><p style="margin-bottom: 0cm; line-height: 100%">
<b>Hello there</b><span style="font-weight: normal"> sunshine </span><i><span style="font-weight: normal">eh</span></i></p>
</body>
</html>

It looks like:

@page { size: 21.59cm 27.94cm; margin: 2cm } p { margin-bottom: 0.25cm; line-height: 115%; background: transparent }

Hello there sunshine eh

But when interpreted by to-markdown.js you get:

**Hello there** sunshine *eh*

Hello there sunshine eh

You cannot, unless you put it there yourself as I did in this post. If you really need it there, hide it in a comment. If you want to later convert it yourself to markdown, use something like pandoc.

إعجابَين (2)

I support transferring to markdown on the post that is displayed to others for some consistency. It’s the raw entry I’m curious about.

How do you get the raw html of a word doc that you could paste in?

Save it as HTML from Word, or copy it to the clipboard and pull the text/html explicitly from the clipboard.

4 إعجابات

If all you care about is being able to reference the raw input at a later point, this component might work for you.

It adds a button to the post menu that shows the raw content on a per-post basis.

5 إعجابات

@jomaxro، ما هو بناء الجملة لترميز التعليق الخام؟

ما الذي تسأل عنه؟ هل تسأل ما هو الماركداون (markdown)؟ مثل https://commonmark.org/ هل تسأل كيف تحصل على الماركداون الخام (raw markdown) لمنشور؟ مثل /raw/123

للمنشور الواحد، يمكنك إضافة المعرّف (ID) إلى عنوان URL. على سبيل المثال، https://meta.discourse.org/raw/189183/27 هو ردك.

إعجابَين (2)

@pfaffman، الخيار الثاني. شكرًا لك، @Moin. هذا واضح، بالنظر إلى الوراء.

@jomaxro، لا تعمل /raw/ في أي من منشورات discuss.kde.org/c/community/blogs/24، فعند view-source:discuss.kde.org/raw/43656، ألاحظ ما يلي:

<pre>Konqi | 2026-01-23 22:43:37 UTC | #1

&lt;p&gt;Leaking memory is impolite. It’s messy, it can suggest logic bugs, and thanks to AI grifters RAM is expensive.&lt;/p&gt;
&lt;hr&gt;
&lt;small&gt;This is a companion discussion topic for the original entry at &lt;a href="https://nicolasfella.de/posts/detecting-leaks-in-kde-ci/?utm_source=atom_feed"&gt;https://nicolasfella.de/posts/detecting-leaks-in-kde-ci/?utm_source=atom_feed&lt;/a&gt;&lt;/small&gt;

---------
</pre>

بينما، عند توسيع details بشكل تفاعلي في discuss.kde.org/t/43656، يمكنني توسيعه إلى:

هل يمكن تلبية هذا الأمر بشكل فعال من جانب Discourse الأصلي؟ لقد لاحظت شيئًا مشابهًا في مثيلات Discourse أخرى مخصصة قليلاً، ولهذا السبب أسأل.

ما المشكلة التي تحاول حلها؟

هذه المواضيع خاصة لأنها روابط لمشاركات كبيرة.

هذا هو النص الأصلي للمنشور الأصلي.

إعجاب واحد (1)

النص الخام للمنشور الأصلي في ذلك الموضوع هو:

○ → curl https://discuss.kde.org/posts/132565/raw
<p>Leaking memory is impolite. It’s messy, it can suggest logic bugs, and thanks to AI grifters RAM is expensive.
</p>
<hr>
<small>This is a companion discussion topic for the original entry at <a href="https://nicolasfella.de/posts/detecting-leaks-in-kde-ci/?utm_source=atom_feed">https://nicolasfella.de/posts/detecting-leaks-in-kde-ci/?utm_source=atom_feed</a></small>

هذا بالضبط ما يتم عرضه في النسخة المنسقة.

إنها ليست كتلة details يتم توسيعها. النقر على Show Full Post يقوم بتحميل شيء آخر، وهو التوسيع الكامل للتضمين، والذي لا يأتي من النص الخام للمنشور ولكن من بيانات وصفية إضافية للمنشور.
يمكنك رؤية طلب الشبكة في متصفحك عند النقر عليه، إليك المكافئ:

○ → curl -s -H 'accept: application/json' 'https://discuss.kde.org/posts/132565/expand-embed' | jq -r .cooked
<div><div>
            <p>Leaking memory is impolite. It’s messy, it can suggest logic bugs, and thanks to AI grifters RAM is expensive.</p>
…
…
…
<p>LSAN is now enabled for some Frameworks CI builds, but ideally it would be enabled for all KDE projects. And of course any leaks found along the way should be fixed.</p>
<p>Happy leak-fixing!</p>
        </div></div>
<hr>
<small>This is a companion discussion topic for the original entry at <a href='https://nicolasfella.de/posts/detecting-leaks-in-kde-ci/?utm_source=atom_feed'>https://nicolasfella.de/posts/detecting-leaks-in-kde-ci/?utm_source=atom_feed</a></small>

هل أردت رؤية محتويات التضمين؟ إذا كان الأمر كذلك، استخدم ما سبق. إذا لم يكن كذلك، فما الذي تتوقعه أن تراه؟

إعجابَين (2)

@supermathie، بالفعل. شكراً جزيلاً! من الواضح أن هناك الكثير من واجهة برمجة تطبيقات ديسكورس (Discourse API) مما أنا على دراية به.

إعجاب واحد (1)