In previous version of react-markdown library I was using, 4.1.3 I could put space before and after some string and it was not trimmed. After upgrade to 8.0.4 there are trimmed. Is it possible to still have the previous behavior?
Example: https://codesandbox.io/s/pedantic-tdd-ygrkdu
Now is rendered as abc and I would like to have a b c
Related
I'm trying to find out which is the smartest way for render some pieces of MySQL queries with Markdown/Macdown editors.
I have tried to apply 4 spaces with ˜˜˜sql markup before the query code snippet but it seems not working well because it doesn't show code highlights.
See the screenshot below:
Any suggestions?
Thanks in advice.
I have tried to apply [four] spaces with ~~~sql markup before the ... code snippet
In Brief:
Don't mix indentation and code fencing
Check the options in your markdown processor
Make sure you use enough tilde characters, ~~~ is not enough, ~~~~ is.
Longer answer:
1. Don't mix indentation and code-fencing
You must choose between indented code blocks and fenced code blocks. Partial mixtures of alternative syntaxes won't work.
# Code Block #
What follows is a fenced code block.
Note that all text starts immediately in the left margin.
There is no indentation of the fences.
There are no extra space characters at the start of these lines.
~~~~sql
update employee
set salary = salary * 2
where salary < 100000
~~~~
The following will not work
~~~~sql
update employee
set salary = salary * 2
where salary < 100000
~~~~
You cannot mix indentation and fencing.
The syntax identifiers are part of the fenced code block syntax. You must also end the code block with a line of tildes.
SQL is a supported language for syntax highlighting.
2. Macdown options
You must also "tick the Enable highlighting in code blocks option." in Macdown.
3. Number of tilde (~) characters is important
(Note O.P. Ugol eventually noticed this - see comments. Initially we both overlooked it)
~~~sql has too few tilde characters, only three
~~~~sql has the correct number of tilde characters to indicate a "fenced block"
I noticed that the highlighting did not work on a Jupyter notebook. By switching to ~~~ mysql it does work (rather than using ~~~ sql).
I'm not sure if this is a web2py problem or a general html problem, but when I create a form in web2py that contains an editable string in a textarea, and the string contains an initial newline, like "\nsecond_line", the textarea does not display or save the newline - it is cut out. It works fine if there is a character before the newline: "firstline\nsecond_line" shows as on two lines. It is also only relevant for the first newline. If I have a string like "\n\nthird_line", then the textarea shows a single newline at the start.
This is with the most recent (non beta) version of web2py, on safari 9.1.3 and chrome 56.0.2924.87.
Ah. "By HTML 4.0 appendix B chapter 3.1, “a line break immediately following a start tag must be ignored, as must a line break immediately before an end tag. This applies to all HTML elements without exception.”"
what syntax of markdown do I need to write the api like below.
the html code is below:
link
<dl class="function">
<dt id="create_bootstrap_script">
<code class="descname">create_bootstrap_script</code><span class="sig-paren">(</span><em>extra_text</em><span class="sig-paren">)</span><a class="headerlink" href="#create_bootstrap_script" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a bootstrap script from <code class="docutils literal"><span class="pre">extra_text</span></code>, which is like
this script but with extend_parser, adjust_options, and after_install hooks.</p>
</dd></dl>
<p>This returns a string that (written to disk of course) can be used
as a bootstrap script with your own customizations. The script
will be the standard virtualenv.py script, with your extra text
added (your extra text should be Python code).</p>
<p>If you include these functions, they will be called:</p>
I've tried to use syntax like this, but turn out to be just like but not the same.
Orange(a, b)
: The fruit of an evergreen tree of the genus Citrus.
Every answer will be appreciated.
In the first example the dt is a codespan which has had syntax highlighting applied.
In the second example, the dt only contains plain text. You can get closer by using a code span as well:
`Orange(a, b)`
: The fruit of an evergreen tree of the genus Citrus.
Notice that the first line is wrapped in backticks (`) which makes it a code span. Of course, you still need syntax highlighting to get an exact match, but MkDocs does not currently support syntax highlighting for code spans, only code blocks. Presumably the virtualenv docs were built using Sphinx rather than MkDocs. While MkDocs comes close to matching Sphinx in looks, it does not match feature for feature and this is one of the differences. That said, it may be possible with a custom theme and/or using some custom Markdown Extensions.
I'm trying to have a Reg Exp for the following:
8 characters min
1 uppercase (at least)
1 lowercase (at least)
1 digit (at least)
Excluding: + # &
I have the following but I can't seem to have the right combo of group/sub-group to make them work together:
[^+#&](?=.*\d)(?=.*[a-z])(?=.*[A-Z])).{8,}
I need guidance!
You need to use anchors and place the negated class after your assertions.
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^+#&]{8,}$
I have some leagacy reporting data which is accessed from SSRS via an xml web service data source. The service returns one big field containing formatted plain text.
I've been able to preserve white space in the output by replacing space chars with a non-breaking space, however, when exporting to PDF leading white space is not preserved on lines that do not begin with a visible character. So a report that should render like this:
Report Title
Name Sales
Bob 100.00
Wendy 199.50
Is rendered like this:
Report Title (leading white space stripped on this line)
Name Sales (intra-line white space is preserved)
Bob 100.00
Wendy 199.50
I've not been able to find any solution other than prefixing each line with a character which I really don't want to do.
Using SQL 2005 SP3
I googled and googled the answer to this question. Many answers included changing spaces to Chr(20) or Chr(160). I found a simple solution that seems to work.
If your leading spaces come from a tab stop replace "/t" with actual spaces, 5 or so
string newString = oldString.Replace("/t"," ")
In the expression field for the textbox I found that simply adding a null "Chr(0)" at the beginning of the string preserves the leading spaces.
Example:
=Chr(0) & "My Text"
Have you tried non-breaking spaces of the ASCII variety?
=Replace(Fields!Report.Value, " ", chr(160))
I use chr(160) to keep phone numbers together (12 345 6789). In your case you may want to only replace leading spaces.
You can use padding property of the textbox containing the text. Padding on the left can be increased to add space that does not get stripped on output.
I have used this work around:
In the Textbox properties select the alignment tab.
In the Padding option section edit the right or left padding(wherever you need to add space).
If you need to conditionally indent the text you can use the expression as well.