How to add a link (inside Mantis) to a note/comment? - mantis

Creating a link to an issue in Mantis is done via the hash symbol # followed by the issue number.
Example: #123
How do I link to a note?

Use the ~ symbol, i.e ~42 to link to the bugnote with the id 42. The prefix is configurable using the $g_bugnote_link_tag setting.
A little clarification, if needed, taken from here: the ~ notation works a little different according to MantisBT version. In 1.1.x shows only the NoteID (e.g., 0026006), but since 1.2.x and above, the link was changed to IssueID:NoteID (e.g., 0009261:0026006).

Form this : http://inform7.com/mantis/view.php?id=259 :
Also for future reference: you can link to another issue by prefixing
the issue number with #, or link to a comment by prefixing the comment
number with ~.
# 259 (without the space) => 0000259
~ 559 (without the space) => 0000259:0000559

Related

How to link to internal link with ampersand?

I am trying to make an internal link to a heading called "word & word".
Since I am using Jekyll, the content is in Markdown files and the heading I want to link to looks like this:
### word & word
I know that I can not use & in URLs.
Therefore this would not be an option:
#word-&-word
I also tried:
#word-%26-word
and
#word-&-word
#word-%26amp;-word
#word-%20amp%3B-word
However, both versions are not working.
What would be the appropriat way to fix this?
Kramdown is striping non alphanumeric from header id's and replacing spaces by -.
You can just check this behavior with :
- mandatory
{:toc}
### word & word
Resulting link in generated table of content is #word--word
See kramdown documentation

Edit ‘JIRA Issues’ Macro , URL ---> fixVersion+%3D+6.0.0-beta3+ha1 gives syntax error

While including JIRA issues Macro on my Wikipage, I am having this issue.
On Jira, for a list of tickets, I have put the the Fix Version = 6.0.0-beta3+ha1 .
By doing so whenever I try to add JIRA Issue, with the following url
http://rdtrack/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=fixVersion+%3D+6.0.0-beta3+ha1&tempMax=1000
I get this message.
The JIRA Issue was not able to process the search. This may indicate a problem with the syntax of this macro.....
What is my understanding is that symbol "+" in 6.0.0-beta3+ha1 is causing this issue. I search on the Internet and found that using special characters like "+, etc.", they should be used within '' or " ". Still using them does solve my issue and I cannot see the list of JIRA tickets using URL mentioned above.
Escape the + as it's a reserved character and remove the unnecessary one from your query.
jqlQuery=fixVersion%3D6.0.0-beta3%2Dha1&tempMax=1000
Building on #rorschach's answer, try the following, which wraps quotes around the fixversion value (which is what you alluded to in your question).
jqlQuery=fixVersion%3D%226.0.0-beta3%2Dha1%22&tempMax=1000
Also, for a little bit more clarification on the +:
In JIRA, it does need wrapping in quotes... and in the URL, it's generally translated to a space. That's why you need to escape the + in the URL, but still quote the escaped fixversion value.

Best format for adding a version id into a URL path

I'm currently re-working an application and want to add in a version number to the application URL paths. For example:
http://mydomain/app/VERSION-ID/resource/...
My question is, what is the correct or standard format to add a version id to a URL string? Is there any disadvantage to just having it numeric (1.1 or 1-1):
Example: https://api.twitter.com/1.1/account/verify_credentials.json
Or is it better to have a non numeric identifier to be more intuitive as the url is public facing?
Thanks.
Do not use dots in a URL unless you're defining domain spaces. Use either dashes or other truncated versions (that don't use disallowed characters in the URL).
EXAMPLE:
Example: https://api.twitter.com/v1-1/account/verify_credentials.json
UPDATE: Here is some more information in another thread. My preference is not to use dots if at all possible, but it is apparently OK to do.
Can urls contain dots in the path part?

What characters are allowed in a dynamic segment (param) in Rails?

I am using Rails and have a user entered field that can become a param in the URL. I'd like to add a validation that stops the users from entering any fields that will cause routing errors, as currently if the user enters a value like that we get an error "No route matches [GET]..." So far I know periods and slashes are not allowed...
What regex should I use for my validation? Or what regex does Rails use by default for dynamic segments?
Since no one has actually answered the question, just suggested workarounds. (Which are probably better, if you are in the right circumstances to use them.) I experimented to find the characters that caused issues. I tested all punctuation available on a standard US keyboard. I also tested space and (horizontal) tab. I did not test any extended Unicode punctuation, nor control characters.
The characters I found to cause problems in Rails 3.2.9, using webrick and the composite_primary_keys gem are:
,/.%
To validate that a field contains none of these characters:
validates :field_name, :format => { :with => /\A[^,\/\.%]*\z/,
:message => "commas, slashes, periods, and percent signs (,/.%) are not allowed"}
Many of the other characters I tried are not valid directly in URLs, but Rails automatically URL encodes them so they do not cause an issue.
As mentioned in the comments on the original question, some of these characters can be enabled by configuring Rails other than the defaults, but in doing so you will disable other features of Rails. To enable them you need to add :constraints or :id settings in your route definition.
I have not completely tested enabling all these characters, but I believe the consequences are:
Ch Consequence of enabling use
-- ---------------------------------------
, Must not use gem composite_primary_keys
/ Limits ability to route to child items
. Disables automatic format handling
% Not sure this can be enabled
Maybe you can let the user insert whatever, than use to_params + parameterize to write the url, and if you want some regex, take a look at the parameterize source code.
Example of to_params, the documentation and source code see:
http://apidock.com/rails/ActiveSupport/Inflector/parameterize
Hope it helps!
From rails code in action_pack action_dispath/journey/path/pattern.rb
#separator_re = "([^#{separator}]+)" # where separator comes from #separators = "/.?"
So the default regular expression used to match a dynamic segment seems to be:
/([^\/\.\?])/

what if html_escape would stop escaping '&'?

is there any danger if the rails html_escape function would stop escaping '&'? I tested a few cases and it doesn't seem to create any problems. Can you give me a contrary an example? Thanks.
If you put an unescaped "&" into an HTML attribute, it would make your page invalid. For example:
Link
The page is now invalid as the & indicates an entity. This is true for any usage of an & on a page (for example, view source and hopefully you'll notice that Stack Overflow escapes the & signs in this post!)
The following would make the above example valid:
Link
Additional Note
& characters do need to be escaped in URLs if you want to validate your markup against the W3C validator. Example:
Line 9, Column 38: & did not start a character reference.
(& probably should have been escaped as &.)
Example
change an url with adding some argument

Resources