HTML/RTF pasting

Yes, I know that. What I’m saying is, I don’t think most users know “paste as plain text” is even an option. It pretty much negates the usefulness of code blocks.

You can turn formatted pasting off globally in your site settings if you are a site owner.

Thanks for letting me know. I’m not the site owner, but I’ll bring up that option with the site owner and see what they think.

EDIT: @codinghorror Am I correct in assuming that there is no user-level setting?

I have been running into this too. Don’t know if it is a recent development but just started noticing it. I use discourse to reply to email often. When I do, I hit reply in the email and then copy and paste the entire email text into my discourse message. It recognizes one level of quoting correctly but encodes the second and third level. So I have to first paste into a plain text editor and do global search and replace, then edit, to get it to look as expected in discourse.

use ctrl+shift+v, it is your friend :wink:

4 إعجابات

If I want to lose all the other formatting too, then yes.

I will try this out next time and see how it turns out.

Thanks.

What about when you’re responding from your phone? At least iPhone doesn’t have the option to paste in plaintext.

Does iPhone retain formatting when copying? I’m not sure it even does?

It does. I just tried it.

4 إعجابات

Perhaps it would make sense to add a button on the reply menu for doing a plain text paste? Though space there is already a little tight on my iPhone 8…

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

@seanblue @tobiaseigen thanks for the report. I will definitely try to improve this. But it’s not in my current priority list.

3 إعجابات

I agree, a plain text menu option would be great when I’m working from my phone.

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

حاولت قراءة المنشور بالكامل، لكن بعد أول عدة فقرات بدأت أكتفي بالاطلاع السريع عليها.

كما جربت أدوات التحويل عبر الإنترنت مع

\+ exist

A \= b

لكنها لم تحوّل \ إلى \\، لذا خرج النص البرمجي/النصي على النحو التالي:

+ exist

A = b


موقعنا (SWI-Prolog) مخصص بلغة البرمجة المنطقية Prolog، وتحديداً SWI-Prolog، وكثير من المنشورات تحتوي على كود مصدر بلغة Prolog. وبما أن Prolog هي لغة برمجة منطقية مبنية على ثلاث عمليات منطقية أساسية: and و or و not، ويُعبر عادةً عن not باستخدام الرمز \ عند استخدامه مع المشغّلات الشائعة، مثل \=/2 و \+/1، كما أن Markdown يستخدم \ كـ حرف هروب، فإن المشغّلات التي تُلصق ضمن النص العادي (وليس داخل أمثلة الكود) غالباً لا تظهر كـ \= أو \+ بل كـ = أو +، لأن عملية تحويل Markdown تستهلك الرمز \ معتقدة أنه حرف هروب.

هل يمكن إصلاح هذه المشكلة؟ :smiley:

ستحتاج إلى اللصق في كتلة كود، لذا اكتب ثلاثة علامات اقتباس عكسية، ثم اضغط على enter، بعدها قم باللصق؟

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

شكرًا لك،

معظم المستخدمين يحيطون كتل الكود بـ ```prolog و ```، وقد لاحظت ذلك في منشوري لأولئك الذين لا يفعلون ذلك.

المشكلة تكمن عندما يكون النص ضمن سطر. كما نعلم، العديد من المستخدمين لا يراجعون ما ينشرونه، أو حتى عندما يفعلون ذلك، من السهل تفويت غياب \. :smiley:


تفاصيل المنشور للمستخدمين في SWI-Prolog

إذا استخدمت حرف \ مع النص داخل السطر، مثل \= أو \+، فسيتم تحويله إلى = أو +، وهو على الأرجح ليس ما كنت ترغب فيه. بينما تحاول منصة Discourse أن تكون ذكية في تحويل النص المنسوخ إلى HTML، فإنها تستخدم أيضًا Markdown، و Markdown يستخدم \ كحرف هروب.

مثال على القيام بذلك بشكل خاطئ: = و +.

للكود داخل السطر، ما عليك سوى إحاطة النص بـ `، مثل `\=` أو `\+`، ويظهر كـ \= أو \+.

أو

مجرد تكرار \ مرتين، مثل لصق \\= أو \\+، فيظهر كـ \= أو \+.

ومع ذلك، إذا كان لديك عدة أسطر من الكود، فاحط الكود بـ ```prolog و ```، وسيتم تحويل قسم الكود بواسطة محول كود المصدر لـ Prolog، مما يترك حرف \ كما هو.

A \= b.
\+ true.

حتى عندما قمت بلصق النسخة هنا، اضطررت للعودة إلى HTML الأصلي ونسخه بدلاً من النص للتأكد من صحته.

أغلق هذا الطلب باعتباره مكتملاً! عمل رائع يا @vinothkannans في بناء هذا.

يمكن وضع التحسينات المستقبلية في مواضيع جديدة للأخطاء أو الميزات.

7 إعجابات