Inserting special character in Redmine wiki page - formatting

I'm using Redmine and I'm trying to insert the special character | inside a table in a Redmine wiki page. I don't want this character to be parsed as a column separator.
I've achieved this by doing a <code>|</code> around this character, but I don't want to use the code tag, since this character will gain code attributes, namely the courier new font.
Is there a tag for displaying plain text and avoid the parsing from the Redmine wiki engine?
I'm reading the redmine wiki formatting documentation but it is very poor and points me to textile formatting which doesn't seem to include this special case.

I could not get the exclimation point to work, but this works for me.
<notextile>|</notextile>

The only way I found out to overcome this problem is to insert the HTML code for the character I want to isolate. For instance, instead of putting an underscore and make the wiki think I'm starting an italic word, I have to put the HTML code for it:
_
Example:
this is a _test - _text comment here_
Without the underscore code (_) redmine wiki engine will think that italic starts at test and this is the wrong result:
this is a test - text comment here
So, putting the ASCII code for the underscore corrects this problem. Unfortunately, this parsing is not very clever (yet I hope).
Here is a link for an ASCII code table with many symbols and characters:
http://www.ascii.cl/htmlcodes.htm

Related

How to write an XPath to select text with a quote & comma character?

How can I select a XPath that contains a text with both quote & comma character?
I have to find an element if the text contains =Yes, It's OK
My XPath does not save in ranorex tool even though if i put the text inside the double quotes like below
//span[text()="Yes, It's OK"]
So how can I save this xpath that uses "".in Ranorex
your use of double-quotes is correct. if
//span[text()="Yes, It's OK"]
doesn't match, it might be because the xpath engine has a lowercase bug (i have encountered PHP+DOMXPath+libxml2 systems where it would only match lowercase text even for text with uppercase characters, never quite figured out the problem there), or it might be because the text has hidden whitespace you're not aware of, maybe it actually has a hard-to-spot whitespace at the start or the end? anyway maybe contains() will work:
//span[contains(text(),"Yes, It's OK"]
or.. if it has the lowercase-issue i have encountered in the wild once before, maybe this will work:
//span[contains(text(),"yes, it's ok"]
(that really shouldn't be required, but i have been in that situation once before, and that was years ago, and that was... probably php5)

Multi-line text in a .env file

In vue, is there a way to have a value span multiple lines in an .env file. Ex:
Instead of:
someValue=[{"someValue":"Here is a really really long piece which should be split into multiple lines"}]
I want to do something like:
someValue=`[{"someValue":"Here is a really
really long piece which
should be split into multiple lines"}]`
Doing the latter gives me a JSON parsing error if I try to do JSON.parse(someValue) in my code
I don't know if this will work, but I can't format a comment appropriately enough to get the point across so see if this will work:
someValue=[{"someValue":"Here is a really\
really long piece which\
should be split into multiple lines"}]
Where "\" should escape the newline similar to how you can write long bash commands while escaping the newline. I'm not certain the .env interpreter will support it though.
EDIT
Looks like this won't work. This syntax was actually proposed, but I don't think it was incorporated. See motdotla/dotenv#333 (which is what Vue uses to parse .env).
Like #zero298 said, this isn't possible. Likely you could delimit the entry with a character that wouldn't show up normally in the text (^ is a good candidate), then parse it within the application using string.replace('^', '\n');

VBA replace certain carriage

All.
I am used to programming VBA in Excel, but am new to the structures in Word.
I am working through a library of text files to update them. Many of them are either OCR documents, or were manually entered.
Each has a recurring pattern, the most common of which is unnecessary carriage returns.
For example, I am looking at several text files where there is a double return after each line. A search and replace of all double carriage returns removes all paragraph distinctions.
However, each line is approximately 30 characters long, and if I manually perform the following logic, it gives me a functional document.
If there is a double carriage return after 30+ characters, I replace them with a space.
If there were less than 30 characters prior to the double return, I replace them with a single return.
Can anyone help me with some rudimentary code that would help me get started on that? I could then modify it for each "pattern" of text documents I have.
e.g.
In this case, there are more than
thirty characters per line. And I
will keep going to illustrate this
example.
This would be a new paragraph, and
would be separated by another of
the single returns.
I want code that would return:
In this case, there are more than thirty character returns. And I will keep going to illustrate this example.
This would be a new paragraph, and would be separated by another of the single returns.
Let me know if anyone can throw something out that I can play with!
You can do this without code (which RegEx requires), simply using Word's own wildcard Find/Replace tools, where:
Find = ([!^13]{30,})[^13]{1,}
Replace = \1^32
and, to clean up the residual multi-paragraph breaks:
Find = [^13]{2,}
Replace = ^p
You could, of course, record the above as a macro...
Here is a RegEx that might work for you:
(\n\n)(?<!\.(\n\n))
The substitution is just a plain space, you can try it out (and modify / tweak it) here: https://regex101.com/r/zG9GPw/4
This 'pattern' tells the RegEx engine to look for the newline character \n which occurs x2 like this \n\n (worth noting this is from your question and might be different in your files, e.g. could be \r\n) and it assumes that a valid line break will be proceeded by a full stop: \..
In RegEx the full stop symbol is a single character wild card so it needs to be escaped with the '\' (n and r are normal characters, escaping them tells the RegEx engine they represent newline and return characters).
So... the expression is looking for a group of x2 newline characters but then uses a negative look-behind to exclude any matches where the previous character was a full stop.
Anyway, it's all explained on the site:
Here is how you could do a RegEx find and replace using NotePad++ (I'm not sure if it comes with RegEx or if a plugin is needed, either way it is easy). But you can set a location, filters (to target specific file types), and other options (such as search in sub-directories).
Other than that, as #MacroPod pointed out you could also do this with MS Word, document by document, not using any code :)

Spaces between elements in HAML

How would you represent this in HAML?:
<a>Link</a> | <a>Link</a>
Note that I want to retain the spaces on either side of the bar.
I would write exactly what you've written, which is perfectly valid HAML. You may embed regular HTML into HAML:
%h1
<a>Link</a> | <a>Link</a>
Sometimes whitespace bites you when you're marking things up with HAML, and there is no pretty way of making your tags come out correctly. That is why HAML gives you the option of falling back to HTML.
Note that, if you're ok with one or more spaces between your links and the |, you can just write regular old HAML:
%h1
%a link
|
%a link
The new lines will be preserved, and render as a space in the browser, where any amount of any kind of whitespace will always be treated like a single space.
Put '|' on next line, new line will be preserved, and render as a white space.
%a link
|
%a link
meagar's answer is how I would do it, you could also use haml filters to write exactly the HTML you need.
This might sound dirty, but filters use is encouraged, see this article : http://chriseppstein.github.io/blog/2010/02/08/haml-sucks-for-content/

Zend Lucene and hyphens - searching part numbers

I have set up Zend Lucene to search products_name and part_number.
This works well, however there are issues with hyphenated part numbers.
For example, if I have the part number: 5130193-00
This will return any part number with '00' at the end.
How can I make Lucene only return the exact part number?
I am using Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive()); when indexing and searching (CaseInsensitive does not work, but that's another issue) and the part numbers are indexed as Text.
Try escaping dash with a slash: part_number:5130193\-00.
More information is available here (see Escaping Special Characters).