svivian / q2a-markdown-editor Goto Github PK
View Code? Open in Web Editor NEWMarkdown editor plugin for Question2Answer
Markdown editor plugin for Question2Answer
the current syntax highlighter doesn't seem to do much of a work. below is a Matlab snippet
As you can see, syntax highlighting is almost non-existent! is this normal?
Is there a way to remedy this?
I tried using the common pack from here , downloaded the highlight.js
file, uploaded it to the pagedown
directory, replaced it with the existing one, also uploaded the styles
folder which was downloaded alongside the js file. yet nothing changed!
I would be grateful if you could shed some light on this and how should someone go about it in order to have a working/decent synatx highlighting capability.
It seems markdown does not count html tags.
Example to reproduce the issue:
set Minimum length of question body to 100 character for example.
question body text:
<p>94 characters here...</p>
So the question body is 101 characters. But It gets the error for min length of question body.
Is is possible to set a language hint for code blocks? What syntax could I use? I tried the Stackoverflow way and the highlight.js way too but netiher seem to work.
Hi, I'm having issues with the markdown editor, as it doesn't seem to allow having a blank line break, as in here...
(blank)
Also, lists are not getting indented
An example is here:
http://respuestas.ca/544/que-se-puede-traer-de-usa-sin-pagar-duty-ni-impuestos
Thanks
As you can see in the picture below, the text is not showing, and there is no scroll at all either.
I have changed the wmd.css
and added overflow-x:auto;
to both code pre
and .wmd-preview pre
so they look like this now :
.qa-q-view-content pre,
.qa-a-item-content pre,
.wmd-preview pre {
overflow: auto;
width: 100%;
max-height: 400px;
padding: 0;
border-width: 1px 3px 1px 1px;
border-style: solid;
border-color: #ddd;
background-color: #eee;
overflow-x:auto;
}
code {
direction: ltr;
}
pre code {
display: block;
padding: 8px;
text-align: left;
direction: ltr;
overflow-x:auto;
}
yet nothing changes.
the irony is , if I change the css attributes using the browsers inspect element, adding the overflow-ax:auto fixes the problem, but the actual changes to the actual css seems not to be taken into account some how.
Hi there,
We're using this plugin on Godot Engine's Q&A, and I've noticed that the behaviour of the ``` and <code>
tags seems to ignore indentation, which is quite annoying when typing code with strict indentation rules like Python or GDScript.
On the other hand <pre>
and an indentation of the whole block work fine:
I reckon that this is probably not a bug per-se, but just that <code>
and any number of backquotes are interpreted as inline code markers, and such inline code does not support indentation or multiple lines code blocks. However many users are used to GitHub's Flavoured Markdown and how it use triple backquotes to delimit pre-formatted code blocks. It would be nice to have support for something similar in q2a-markdown-editor.
This plugin only highlights intended code blocks.
See also #19
Code:
Example code:
var test = "string";
var test = "string" + 1 + obj.goReady();
Other:
```
var test = "string";
var test = "string" + 1 + obj.goReady();
```
Is this plugin compatible with 1.7? I can't make it work. Won't show up as an option
Can we get an integrated function to ask the user before leaving a page?
Plugins like https://github.com/q2apro/q2apro-warn-on-leave do not work, because they are editor-specific/need to be aware of the editor.
Could you integrate that as an option for everyone maybe?
Also asked the other plugin for support: https://github.com/q2apro/q2apro-warn-on-leave/issues/1
Examples:
This:
MessageBox.Show("Mesage", "Title", MessageBoxButtons.OK, MessageBoxIcon.Information) ;
Shows this:
MessageBox.Show("Mesage", "Title", MessageBoxButtons.OK, MessageBoxIcon.Information) ;
This:
eval ('$'.$a.'='.$b);
Shows this:
eval (\'$\'.$a.\'=\'.$b);
How can this be fixed ? A lot of posts are going to be incorrect because of this.
Thanks.
The HTML introduced by the plugin is not valid. Here is a patch to make it valid.
--- a/qa-plugin/markdown-editor/qa-markdown-editor.php
+++ b/qa-plugin/markdown-editor/qa-markdown-editor.php
@@ -24,7 +24,7 @@ class qa_markdown_editor
function get_field(&$qa_content, $content, $format, $fieldname, $rows, $autofocus)
{
$html = '<div id="wmd-button-bar-'.$fieldname.'" class="wmd-button-bar"></div>' . "\n";
- $html .= '<textarea name="'.$fieldname.'" id="wmd-input-'.$fieldname.'" class="wmd-input">'.$content.'</textarea>' . "\n";
+ $html .= '<textarea name="'.$fieldname.'" id="wmd-input-'.$fieldname.'" class="wmd-input" cols="80" rows="15">'.$content.'</textarea>' . "\n";
$html .= '<h3>Preview</h3>' . "\n";
$html .= '<div id="wmd-preview-'.$fieldname.'" class="wmd-preview"></div>' . "\n";
@@ -33,7 +33,7 @@ class qa_markdown_editor
// $html .= '<script src="'.$this->pluginurl.'pagedown/Markdown.Editor.js"></script>' . "\n";
// comment this script and uncomment the 3 above to use the non-minified code
- $html .= '<script src="'.$this->pluginurl.'pagedown/markdown.min.js"></script>' . "\n";
+ $html .= '<script src="'.$this->pluginurl.'pagedown/markdown.min.js" type="text/javascript"></script>' . "\n";
return array( 'type'=>'custom', 'html'=>$html );
}
And
--- a/qa-plugin/markdown-editor/qa-md-layer.php
+++ b/qa-plugin/markdown-editor/qa-md-layer.php
@@ -48,7 +48,7 @@ class qa_html_theme_layer extends qa_html_theme_base
if ( $usehljs )
{
$this->output_raw(
- "<script src=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "pagedown/highlight.min.js\"></script>\n" .
+ "<script src=\"" . QA_HTML_THEME_LAYER_URLTOROOT . "pagedown/highlight.min.js\" type=\"text/javascript\"></script>\n" .
"<script type=\"text/javascript\">\n" .
"$(function(){\n" .
Hi Svivian,
just to let you know that I found a problem between q2a confirm master & markdown, because I ask a minimum of caracters when creating a post (exemple with my q2a http://odlg.org , http://net-on.org and http://mr-ginseng.com ) and it work fine with markdown only when creating a post, but not when replying to a question.
The problem is when users try to answer questions, (and I put a minimum of caracter) confirm master always ask confirmation (so user cant understand why), so they have to leave the page (and lost everything). So you will tell me that the problem come from confirm master, but its working fine with other editors thats the point.
I hope I was clear enough.. ;)
You can see this demo:
http://q2achina.sinaapp.com/686
First sentence, I use code format.
I use markdown editor and mathjax to write math formula, sometimes it cannot show corrected form, here is the example:
Is this a markdown editor's bug?
When I use Basic Editor,it is OK.
Furthermore, in the Preview of markdown editor, the formula shows OK, but when I finish the editor, the answer shows problem.
Hi Scott,
Thank you for your great work.
Do you have any plan to make MarkDown Editor button bar responsive?(Maybe Something like https://simplemde.com/)
Thanks.
Hi, First of all, thank you very much for the latest update. It has become indeed very useful.
Although the new image upload feature is great, resizing the image when uploading doesn't always result in a satisfying outcome.
Dont you think it would be much better if we uploaded the whole image, and either used a thumbnail linked to the original image or altogether went and uploaded the full-sized image?
In our site, users usually post screenshots of the errors they get, and when the image is resized, the text becomes unreadable!
what do you say?
I think preview feature of this editor is killing. So that feature alone makes this editor makes it one of the best in Q2A.
But I need to be sure that, if the plugin is compatible to Q2A 1.7 before I apply this on my website.
If you make a post with escaped characters like , it previews and posts correctly the first time. If you go back to edit a post that has escaped characters, however, it loses the escaping backslash. This means that if I type my\\windows\\path\\
it will save correctly as my\windows\path
, however if I go and edit it, it will appear in the edit box as my\windows\path
and then subsequently save as mywindowspath
.
Awesome plugin by the way :-)
can upload zip files in ask question page
Some questions use names such as Foo_Bar. If the name occurs twice pagedown seems to detect it as an italic directive.
This sentence:
Lorem Foo_Bar is Foo_Bar ipsum.
will look like
Lorem Foo Bar is Foo Bar ipsum.
without the space preceding the first Bar and succeeding the second Foo.
For example. Github flavored markdown does not allow for starting italic mid-word using this syntax.
It is possible to correct this behavior (not allow starting italic mid word and end it mid word) or disable the underscore as an italic operator?
I imagine that some kind of trim() is being called on the input to the edit box during the save step, because if you start input with 4 spaces, the preview pane looks fine, but when you go and post it, the code block is messed up because it loses the first 4 spaces. It may not be necessary/desired to trim the input like that - it seems like a bug from my point of view.
I have installed the plugin in the qa-plugin/
folder and I have activated it on the admin panel. Markdown renders perfectly, but the preview is not showing. Am I missing something?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.