Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text formatting question #8

Open
vvzar opened this issue Dec 11, 2016 · 2 comments
Open

Text formatting question #8

vvzar opened this issue Dec 11, 2016 · 2 comments

Comments

@vvzar
Copy link

vvzar commented Dec 11, 2016

How can I set links to open in new window? Same as target=_blank

"info" : [{
				"added" : "2014-06-25 18:09:28",
				"addedBy" : 1,
				"article" : "**Header**\n\r [(name of link)](http://somedomain.name)",

Is anywhere description for text formatting codes?

Like:

##Text## some header?
**text** - strong text?
\n\r\ - end of string?
[(linkname)](link)
@Leeft
Copy link
Owner

Leeft commented Dec 13, 2016

Getting links to open in a new window out of the box isn't possible as far as I'm aware, no flavour of markdown supports that. Also, it's generally frowned upon to do it (though yes, I do use it myself, as many users probably aren't aware of things like middle-clicking a link to open to a new tab). You can maybe write some JavaScript to add a target attribute to any links after the markdown has rendered.

Formatting codes: https://daringfireball.net/projects/markdown/syntax

@vvzar
Copy link
Author

vvzar commented Dec 13, 2016

Thank you! Another question: When I add second block "info" to the json, cycle drawing header twice. Like:

##Information##
text
(source)
##Information##
text
(source).

Is any way to avoid this behavior? So blocks will look:

##Information##
text
(source)
text
(source)

I`m talking about this function:

17 : function (a, b, c, d, e) {
					var f;
					return "    <article>\n" + (null != (f = (c.uiSection || b && b.uiSection || c.helperMissing).call(null != b ? b : {}, "Information", 1, {
								name : "uiSection",
								hash : {},
								fn : a.program(18, e, 0),
								inverse : a.noop,
								data : e
							})) ? f : "") + "    </article>\n"
				},

This way, I can add target to the block:

19 : function (a, b, c, d, e) {
					return '          <p class="system-blurb-source"><a href="' + a.escapeExpression(a.lambda(null != b ? b.source : b, b)) + '" target="_blank">(source)</a></p>\n'
				},

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants