611

Notes:

  • Answers will occasionally be moved to the Sandbox archive when there are too many of them. When using them to report bugs, keep an eye on the post.
  • This site, Meta Stack Exchange, is usually used as a "test bed" for pending changes happening to the way text is rendered on all network sites. Changes to text rendering that are going to be rolled out to the network are usually deployed here first to test them out and fix any potential glitches. Currently, there are no such changes pending, but if there were, keep in mind that text posted here may render differently from the other sites until the changes roll out to them as well.

As per Jeff's suggestion in this comment:

You can use this question as a formatting sandbox. You can:

  • edit this question itself (Community Wiki questions such as this one require only 100 reputation to edit instead of 2,000)
  • post answers to this question (This question might be protected, requiring earning 10 reputation on this site to answer)
  • post comments to this question or its answers
  • test suspected bugs with the editor or the rendering
  • post ponies (only when mods are asleep)

Beware that since the changes to syntax highlighting in December 2010, and the inline hints added in March 2011, no syntax highlighting is applied unless the question's tags or an inline hint enable it. So, to test highlighting here in the sandbox:

  1. As of January 8, 2019, you can use GitHub-flavor fenced code blocks in your posts, specifying the language after the opening fence:

    ```html
    While not hinted otherwise: <html></html> source <b>goes</b> "here".
    ```
    
    ```js
    var a = 3;
    while (not (a > 0)) {
        alert("JavaScript code <b>goes</b> here.");
    }
    ```
    
  2. Or:

    • Create code blocks in any way (using the fence notation above, the four-space indent form, or using HTML <pre><code> tags).

    • Save your post.

    • Use your browser's developer tools to edit the resulting HTML. To open developer tools, press F12, or ⌥⌘ I on Mac.

    • Find the <pre> element and add the attribute class="prettyprint", or change it into one of the valid syntax hints linked above, like class="lang-vb prettyprint".

    • Run the following in the location bar: javascript:prettyPrint(); or prettyPrint() in the console.

Answers that are considered annoying or obnoxious, or that cause breakage for users, will be deleted. This is codified as a policy as of March 29, 2018.

92
  • Bold code block.Italic code block. Mar 4 '19 at 12:36
  • Is new line working correct? Adding two spaces at the end of this line And now the new line... And another another... No new lines :(
    – smajli
    Mar 5 '19 at 11:14
  • New line </br> continue in new line...
    – smajli
    Mar 5 '19 at 11:16
  • Test: meta.stackexchange.com/questions/324682/…
    – Alex
    Mar 17 '19 at 2:35
  • Do HTML &quot; entities &quot; work&nbsp;? Guess not. Apr 1 '19 at 22:18
  • 11
    A comment with some weird markdown, to test and help this user. Look tags work too, and so does tour. Apr 6 '19 at 1:59
  • 12
    Note: Do not remove @BhargavRao's comment, or you will break this answer
    – wizzwizz4
    Apr 6 '19 at 17:16
  • @BhargavRao When sandbox answers are moved to the archive, comments such as this one -- on the question itself -- aren't migrated; they're deleted.
    – rgettman
    Apr 9 '19 at 19:37
  • 7
    ‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‬‭‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‬‭‮ Such an odd comment...‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‬‭‮‬ Jun 18 '20 at 1:16
  • 2
    ‮sdrawkcab si tnemmoc sihT Jul 4 '20 at 1:03
  • 1
    SOBotics Tool to get the source text of this comment. Single backslash and single backtick: \, `. Type: ``\``, `\``. Jul 12 '20 at 23:23
  • 7
    Note: Do not remove @wizzwizz4's comment, or you will not know that you don't have to delete Bhargav Rao's comment. Jul 18 '20 at 11:49
  • 1
    ‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‬‭‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬ ‬‬‭backward comment‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‮‭‬‭‭‬ ‭‮‬‬
    – ppwater
    Nov 30 '20 at 1:32
  • 2
    @ppwater pasting the contents of your comment after selecting the spaces after it too into TextEdit and hitting backspace crashes on macOS Catalina. ¯\_(ツ)_/¯ It appears it split my cursor in two???? Jan 31 at 21:14
  • 2
    Oh, and [something](//) behaves just like [something](https://), too. May 5 at 11:56

186 Answers 186

1
3 4 5
6
7
0

<\!--> <file_check type="TEST" option="Test"> 1 </file_check>

0

lang-autoit

#include <WinAPI.au3>

MsgBox(0, "", "error: " & @error & @CRLF & "hFind: " & $hFind & @CRLF & "hRadio: " & $phRadio)
_WinAPI_CloseHandle($phRadio)
_BluetoothFindRadioClose($hFind)

Func _BluetoothFindFirstRadio(ByRef $phRadio)
    Local $tBLUETOOTH_FIND_RADIO_PARAMS = DllStructCreate('DWORD')
    DllStructSetData($tBLUETOOTH_FIND_RADIO_PARAMS, 1, DllStructGetSize($tBLUETOOTH_FIND_RADIO_PARAMS))
    Local $aResult = DllCall($hDllBthProps, "handle", "BluetoothFindFirstRadio", "struct*", $tBLUETOOTH_FIND_RADIO_PARAMS, "handle*", 0)
    If @error Then Return SetError(2, @error, 0)
    $phRadio = $aResult[2]
    Return SetError($aResult[0] = 0, 0, $aResult[0])
EndFunc   ;==>_BluetoothFindFirstRadio

lang-vb

#include <WinAPI.au3>

MsgBox(0, "", "error: " & @error & @CRLF & "hFind: " & $hFind & @CRLF & "hRadio: " & $phRadio)
_WinAPI_CloseHandle($phRadio)
_BluetoothFindRadioClose($hFind)

Func _BluetoothFindFirstRadio(ByRef $phRadio)
    Local $tBLUETOOTH_FIND_RADIO_PARAMS = DllStructCreate('DWORD')
    DllStructSetData($tBLUETOOTH_FIND_RADIO_PARAMS, 1, DllStructGetSize($tBLUETOOTH_FIND_RADIO_PARAMS))
    Local $aResult = DllCall($hDllBthProps, "handle", "BluetoothFindFirstRadio", "struct*", $tBLUETOOTH_FIND_RADIO_PARAMS, "handle*", 0)
    If @error Then Return SetError(2, @error, 0)
    $phRadio = $aResult[2]
    Return SetError($aResult[0] = 0, 0, $aResult[0])
EndFunc   ;==>_BluetoothFindFirstRadio

lang-ts

#include <WinAPI.au3>

MsgBox(0, "", "error: " & @error & @CRLF & "hFind: " & $hFind & @CRLF & "hRadio: " & $phRadio)
_WinAPI_CloseHandle($phRadio)
_BluetoothFindRadioClose($hFind)

Func _BluetoothFindFirstRadio(ByRef $phRadio)
    Local $tBLUETOOTH_FIND_RADIO_PARAMS = DllStructCreate('DWORD')
    DllStructSetData($tBLUETOOTH_FIND_RADIO_PARAMS, 1, DllStructGetSize($tBLUETOOTH_FIND_RADIO_PARAMS))
    Local $aResult = DllCall($hDllBthProps, "handle", "BluetoothFindFirstRadio", "struct*", $tBLUETOOTH_FIND_RADIO_PARAMS, "handle*", 0)
    If @error Then Return SetError(2, @error, 0)
    $phRadio = $aResult[2]
    Return SetError($aResult[0] = 0, 0, $aResult[0])
EndFunc   ;==>_BluetoothFindFirstRadio

lang-js

#include <WinAPI.au3>

MsgBox(0, "", "error: " & @error & @CRLF & "hFind: " & $hFind & @CRLF & "hRadio: " & $phRadio)
_WinAPI_CloseHandle($phRadio)
_BluetoothFindRadioClose($hFind)

Func _BluetoothFindFirstRadio(ByRef $phRadio)
    Local $tBLUETOOTH_FIND_RADIO_PARAMS = DllStructCreate('DWORD')
    DllStructSetData($tBLUETOOTH_FIND_RADIO_PARAMS, 1, DllStructGetSize($tBLUETOOTH_FIND_RADIO_PARAMS))
    Local $aResult = DllCall($hDllBthProps, "handle", "BluetoothFindFirstRadio", "struct*", $tBLUETOOTH_FIND_RADIO_PARAMS, "handle*", 0)
    If @error Then Return SetError(2, @error, 0)
    $phRadio = $aResult[2]
    Return SetError($aResult[0] = 0, 0, $aResult[0])
EndFunc   ;==>_BluetoothFindFirstRadio

lang-java

#include <WinAPI.au3>

MsgBox(0, "", "error: " & @error & @CRLF & "hFind: " & $hFind & @CRLF & "hRadio: " & $phRadio)
_WinAPI_CloseHandle($phRadio)
_BluetoothFindRadioClose($hFind)

Func _BluetoothFindFirstRadio(ByRef $phRadio)
    Local $tBLUETOOTH_FIND_RADIO_PARAMS = DllStructCreate('DWORD')
    DllStructSetData($tBLUETOOTH_FIND_RADIO_PARAMS, 1, DllStructGetSize($tBLUETOOTH_FIND_RADIO_PARAMS))
    Local $aResult = DllCall($hDllBthProps, "handle", "BluetoothFindFirstRadio", "struct*", $tBLUETOOTH_FIND_RADIO_PARAMS, "handle*", 0)
    If @error Then Return SetError(2, @error, 0)
    $phRadio = $aResult[2]
    Return SetError($aResult[0] = 0, 0, $aResult[0])
EndFunc   ;==>_BluetoothFindFirstRadio

0

[draft for something else.]


Note: This question is off-topic for Stack Overflow. See How to download video with blob url? on Super User instead.

0
[tag:feature-request]
Just a post to see of there is a bug here. Have seen some strangeness when posting another Meta thread and want to reproduce it if possible before reporinting it. 

The word wrap was broken all kinds of ways and the tag did not render at all. Maybe it has something to do with editing in both modes (a bit in one mode, then a bit in another). I think it has put this code into some kind of code block.
2
  • Yup. Definitely seeing it here.
    – ouflak
    Feb 5 at 11:58
  • Looks like it's defaulting to a code block for some strange reason.
    – ouflak
    Feb 5 at 12:19
0

first line second line

first line

second line

first line
second line

first line with two spaces at the end
second line

0


The Question.

In July 2015, the insert image feature of the toolbar of the Stack Exchange markdown editor was changed (shortcut Ctrl+G, displayed as the icon "toolbar button to insert image" ).

The behavior since then has been to make the image clickable by default - by adding an extra link to the image itself.1, 2

But the official help pages - Meta Stack Exchange markdown formatting help on how "images can be added primarily by using the the editor toolbar button "toolbar button to insert image"
" (see Images at the bottom of the page) and Meta Stack Overflow markdown editing help on images - have still not been updated to reflect this change (now more than five years later).

Shortly after I posted this question/request, a moderator and Senior Product Support Specialist wrote in a comment that the syntax for images was not changed and is still the same, concluding the syntax in the help pages is correct. - Which indeed is true if you take on a very narrow fail-of-conformity attitude concerning what help and guidance is needed to settle whether a suggested edit should be accepted or rejected.


Let me use a pilot case to explain why I think that a well-thought-out update of the help pages would benefit us all. To see the revision history of the question I have in mind, click on the image below, possibly holding down Ctrl+Shift (if you want it to open in a new tab).

Revision history of question Converting a POSTMAN request to Curl.

If you study the revisions of that question, you will notice that edit number 2 was rolled back. The editor who rolled it back commented: @Henke That edit has made the post worse.

Just to be clear - I completely agree that rolling back the edit was the right thing to do. But the question remains: on what grounds? Just referring to gut feeling? Or by saying the edit made the post worse? Without any further references this is simply not good enough or acceptable as a motivation. Out of respect for both the editor and the reviewers we must be capable of doing better than that!

Let me for a moment put myself in the shoes of the editor/reviewers of the edit that made the image non-clickable. Suppose I go to one of the help pages, such as the Meta Stack Exchange help about adding images. The current content about images is shown below.3

Meta Stack Exchange help on how to add an image

If the editor in this case did their homework and read the help page, they would conclude that an image can be input similarly to adding a link by using the suggested syntax:4
![sample image](https://example.com/img.jpg)
Judging from this help page neither the editor nor the reviewers did anything wrong!

Why on earth would they look any further? In my mind this is exactly how a help page is supposed to work. You look up whatever information you need and apply whatever syntax you find there. Bear in mind that a first-time reader might not even consider that an image could be clickable.


I have taken the liberty of supplying an answer of my own, so that you can vote it up or down however you like.5



When can we expect the help pages to be updated?



References:
From now on, the image uploader automatically wraps images in a link to themselves
Meta Stack Exchange help on how to add an image via "toolbar button to insert image"
Meta Stack Overflow Markdown Editing Help: Images
The recommended syntax for an image with a link
Extra square brackets and numbers when using automated link or add picture feature in ...
Why does the images index on Stack Overflow appear twice?



1 The previous default behavior was to just display the image - without any click link.
2 If you are curious to learn more about how this works, see the reference list. - Or simply click the Edit feature of this question and start reading the markdown code. I have included a few different styles and methods on how to make an image clickable or non-clickable.
3 If you find it difficult to read the text in the image, click on it, and then on the back arrow of your web browser.
4 Of course, this syntax will not result in a clickable image.
5 There is nothing personal about these downvotes. It is just an elegant way of finding out the opinion of the community as a whole.



0
0

As another answer points out, find() is the best solution here, but if the username is not unique and you want an array of users where username is 'Billy' then use filter()

const jsonData = {
  "Customers": [{
      "userid": 73063,
      "username": "BOB",
    },{
      "userid": 73138,
      "username": "Billy",
    },{
      "userid": 74139,
      "username": "Billy",
    }]}

const onlyBillys = jsonData.Customers.filter(c => c.username === 'Billy');
let userIds = [];
for (let i in onlyBillys) {
  userIds.push(onlyBillys[i].userid);
}
console.log(userIds);

0

const words = ['save', 'hello', 'world', 'save'];
_.forEach(_.filter(words, elem => { return elem==='save' }),
  word => { console.log(word+' '); });
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.19/lodash.js"></script>

0

In response to Set a test collection variable accessible for each request test in Postman.

Is it possible to put this declaration inside the collection test so that I can use it in each of my request test without having to rewrite it every time ?

My answer: no, that is not possible.
Read on if you want to know how I came to this conclusion.


I made a simple little experiment. You can replicate it as explained below.

I have created a Postman collection by the name TestCollection.
It can be downloaded and saved to your local drive from:
https://schulze.000webhostapp.com/postman/variables/TestCollection.pm_coll.json

Then - from the Postman desktop app (not the chrome extension) - the TestCollection can be imported as shown in the figure below.

Import the collection TestCollection.


To open the collection window, click on the three mini circles next to the collection name (tooltip: View more actions). Then click Edit as in the figure below.

Open the collection window of TestCollection.


As shown below, click on the Tests tab.
The JavaScript snippet for the test of the collection is:

pm.test('Collection Test', function () {
  pm.response.to.have.status(200);
});
console.log('Hello from Collection Test!');
const jsonData = pm.response.json();
console.log('Collection Test says URL = ' + jsonData.url);

In this case, the // Do something useful with jsonData variable of the question is to print the URL of the request in the console.

Collection test prints the URL of the request in the console.


Next click on the TestCollection-Request ...

Open the TestCollection-Request.

... and then on its Tests tab as shown in the figure below.
(The GET request is https://postman-echo.com/get. - Click the image to make it larger.)
The JavaScript snippet for the test of the request is:

pm.test('Request Test', function () {
  pm.response.to.have.status(200);
});
console.log('Hi from Request Test.');
const jsonData = pm.response.json();
console.log('Request Test says user-agent = ' +
    jsonData.headers['user-agent']);

The // Do something useful with jsonData variable of the question is now to print the user-agent of the request in the console.

Click the blue Send button ...

The TestCollection-Request - click Send.


... and then open the Console in the bottom left corner.

The output in the console shows that the collection test runs before the request test.

The console shows that the collection test runs before the
request test.


To answer the question asked, in the second JS code snippet (belonging to the request) we should comment out the declaration (and initialization) of the jsonData variable, and then see what happens when the request is sent again.
The result of doing this is shown the figure below.

The value of CollectionVar has changed to Some New Value.

As the figure shows, this results in a ReferenceError: jsonData is not defined.

I think it is rather obvious what is going on here. Once the scope of the second JS code snippet becomes alive, the scope of the first JS code snippet (belonging to the collection) is already dead. This means that - in the second code snippet - the jsonData variable was never declared.


To confirm this result, consider what will happen if - in the second code snippet only - we (uncomment row 5 and) rename the jsonData variable to say otherJson.
See the result in the figure below.

The value of CollectionVar has changed to Some New Value.

Confirmed! - Even though jsonData of the collection snippet and otherJson of the request snippet contain the exact same data, they are still two completely different and unrelated JavaScript variables belonging to two completely different and unrelated scopes. Think of the two code snipppets being in two different files, if that helps.


References:
Postman: The Easy Way to Work with APIs
Types of Scope

0
#include <MsgBoxConstants.au3>

Global $timeout = 3

example_1()
example_2()

Func example_1()
    Local $returnValue = MsgBox($MB_YESNO, "Example", "Press a button :-)")

    If $returnValue = $IDYES Then
        MsgBox($MB_OK, "OK", "You pressed Yes!", $timeout)
    Else
        MsgBox($MB_OK, "Ok", "You pressed No!", $timeout)
    EndIf
EndFunc   ;==>example_1

Func example_2()

    Switch MsgBox($MB_YESNOCANCEL, "Example", "Press a button :-)")
        Case $IDYES
            MsgBox($MB_OK, "OK", "You pressed Yes!", $timeout)
        Case $IDNO
            MsgBox($MB_OK, "OK", "You pressed No!", $timeout)
        Case $IDCANCEL
            MsgBox($MB_OK, "Cancel", "You pressed Cancal!", $timeout)
    EndSwitch
EndFunc   ;==>example_2
0

The reputation requirement remains at 1,500.

I disagree. My argument is as follows.

  • There are probably not all that many users with a reputation < 1,500 who are active here at meta. Even among users with a reputation > 1,500 quite a few of them might not even have an account at meta. What I am trying to convey is that the review queues are very unlikely to be flooded with "low-repers" suggesting lots of bad new tags. And if this is the case, I don't see any good reason to shut out those of us who want to contribute by proposing high-quality tags.

We (low-repers) are much more likely to give up such ambitions and use whatever poor existing tag is at hand as a replacement. Very discouraging to me.

Anyone who has access to this meta site is also free to ask any question (and hence make a request). The outlook for anyone (regardless of reputation) who proposes a bad tag is that they may expect to see their request heavily downvoted. This in itself should be enough of a barrier to protect against suggesting bad tags, I think.


1 Like myself - I admit to being biased here.

0

Footnotes are weird

testaabbc [^1]

test2 ^2

test 3 3

[^1]: The URL is https://www.google.com

0

The new code editor:

Heading

Bold

Italic

Inline code

Blockquote

Code block

(Shift + Enter to exit code blocks)

Image

Table (original content header 1 header 2 header 3
cell 1 cell 2 cell 3
cell 4 cell 5 cell 6
cell 7 cell 8 cell 9
  1. Numbered list
  • Bulleted list

Horizontal rule (above)

User Community - Meta Stack Overflow An attempt to rope @Community into the post (related to a joke on Meta Stack Overflow User Community - Meta Stack Exchange Let's see if it works. [spoiler]experiment-spoiler[/spoiler] Fails. 🙁

0

Testing Rollbacks

Just a test answer to get my hands on rollbacks. Edit 1111 Edit 2222

0

Scenario is I run a hat company, and every year the hat regulator gives us a guideline as to how much we can increase the price:

Year Price increase
2015 n/a first year
2016 +3.2%
2017 +2.2%
2018 +4.0%
2019 +1.0%
2020 +0.0%
2021 +4.0%

So far, I've worked out how to use product and filter to quite easily produce the following output...

Year Price increase Hat price
2015 n/a first year £3.00000
2016 +3.2% £3.09600
2017 +2.2% £3.16411
2018 +4.0% £3.29068
2019 +1.0% £3.32358
2020 +0.0% £3.32358
2021 +4.0% £3.45653

...But in the real world, I wouldn't apply an uplift of 2.2% to a £3.09600 hat and sell it for £3.16411, I actually want to apply it to rounded numbers, so I'd want to calculate (£3.10 + 2.2%) -> £3.1682 -> £3.17 in 2017 for instance. That's a penny different, and I want to introduce these penny differences as they will accumulate over time in the real world.

Does anyone have any suggestions for how I might build a "real world" calculation, where I'd round the price off every year and only apply the increase to the rounded price? Easy in Excel, but I can't work out a way to do it in Power BI without producing a new column for each consecutive year, which is impractical given the size of the real data set.

Ideally I'd want my data set to look like this...

Year Hat price last year Price increase Hat price this year
2015 n/a n/a £3.00
2016 £3.00 +3.2% £3.10
2017 £3.10 +2.2% £3.17
2018 £3.17 +4.0% £3.30

I'd been trying to do something in DAX but I don't think I can direct a calculated column to itself, so I suspect a Power Query solution might be better - but I'm open to a solution in either sphere!

0

:root {
    --xyz-ease: cubic-bezier(.26,2.05,.84,.38);
}

body {
    margin: 0;
    height: 100vh;
    display: grid;
    place-items: center;
    background: #466BDA;
}

.phone {
    background: white;
    padding: 1.5em;
    border-radius: 2em;
    position: relative;
    transform: rotateZ(-45deg);
    box-shadow: -30px 30px 0px rgba(0,0,0,.1);

    &:before {
        content: " ";
        position: absolute;
        background-color: #466BDA;
        border-radius: 1em;
        padding: .5em;
        width: 33%;
        top: -5px;
        left: 30%;
    }
}

.square-group {
    display: grid;
    grid-template-areas:
        "square square"
        "square square";

    .square {
        padding: 3em;
        margin: .6em;
        border-radius: .8em;
        background-color: #466BDA;
    }
}

.skeleton-title, .skeleton-title2 {
    padding: .6em;
    margin: 1em .3em;
    border-radius: .8em;
    background-color:#466BDA;
}
.skeleton-title2 {
    width: 60%;
}

.circle-group {
    display: grid;
    grid-template-areas:
        "circle circle circle"
        "circle circle circle";

    .square {
        padding: 2em;
        margin: .6em;
        border-radius: 50%;
        background-color: #466BDA;
    }
}

the output is big so you wont see

0

But what if, hear me `out, I just place

a backtick and

let it do whatever`?

Because inline is fine, but if it's multiline, does it disallow blanks?

what if a paragraph is awkwardly placed?

what about inline single, double, triple?

line

this is also 
    a part of the block
0

testing some testz

https://127.0.0.1:80

test

0

This is a test for a crude markdown "parser" (which is really more of an identifier than anything else, but I have a lot of edge-cases to test). Though using a unit test would make this easier, wouldn't it?

This is plain text. This is plain text after a newline.

This is plain text after a blank line. This is not a code block

This is a code block

And here's some text

and another block

Followed by text

And here's even more text

 ... and (you guessed it)
another block
std::cout << "Followed by backticks" << std::endl;
print("Immediately followed by another block")

With an inline triple start, followed by double and single, and some random bold, because why not?

also a link (inline), and another link that's named.

This is not an image

And neither is this

... but pretends to be one on a TV show.:tm:

0

One column table |C| |-| |1|

0

Is this the only sentence?

Probably.

I can't type Hi, in the beginning!

0

This is a test sentence for testing purposes.


Testing ~ in URLs:

0
0
<!-- language-all: lang-swift -->

Ok I gave a [VBA solution][1] but here's a pure Excel version using the relatively new LAMBDA functions, no VBA. 

To achieve this I have created a named function with signature `printf(mask, tokensArray)` where:
 - `mask` is a string you want to format, containing positional `{}` or indexed `{i}` interpolation locations.
 - `tokensArray` is the set of values to be substituted in, supplied as either a 1D Range (row or column), an array (hardcoded or returned from a function) or a single value.

... and which returns a formatted string. Called from a cell like:

[![Tooltip][3]][3]


[![Usage][4]][4]

    =printf("Some text '{1}', more text: '{2}'", A1:A2) //continuous 1D row/col
    =printf("Some text '{1}', more text: '{2}'", {"foo","bar"}) //hardcoded array
    =printf("Single Value {1}", "foo")

or with positional args (left to right)

    =printf("Some text '{}', more text: '{}'", A1:A2)

---

Define these two functions by entering them in the name manager (see [LAMBDA function][2] MSDN docs for detailed instructions, though this link will die I'm sure...) :

| Param     | Value                                                                                                                                                                                                                                                                                                                                            |
|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Name      | ReplaceRecursive                                                                                                                                                                                                                                                                                                                                 |
| Scope     | Workbook                                                                                                                                                                                                                                                                                                                                         |
| Comment   | Recursively substitutes {} or {i} with tokens from the tokens list, which it escapes one by one leaving \} in the result string                                                                                                                                                                                                                  |
| Refers To | `=LAMBDA(mask,tokens,i,tokenCount, IF(i >tokenCount, mask, LET(token, INDEX(tokens,i),escapedToken,SUBSTITUTE(token,"}", "\}"),inIndexedMode,ISERROR(FIND("{}",mask,1)),substituted, IF(inIndexedMode, SUBSTITUTE(mask,"{"&i&"}", escapedToken),SUBSTITUTE(mask, "{}", escapedToken,1) ),ReplaceRecursive(substituted,tokens,i+1,tokenCount))))` |

<details><summary>Prettified<\summary>
```lang-swift
=LAMBDA(
    mask,
    tokens,
    i,
    tokenCount,
    IF(
        i > tokenCount,
        mask,
        LET(
            token,
            INDEX(
                tokens,
                i
            ),
            escapedToken,
            SUBSTITUTE(
                token,
                "}",
                "\}"
            ),
            inIndexedMode,
            ISERROR(
                FIND(
                    "{}",
                    mask,
                    1
                )
            ),
            substituted,
            IF(
                inIndexedMode,
                SUBSTITUTE(
                    mask,
                    "{" & i & "}",
                    escapedToken
                ),
                SUBSTITUTE(
                    mask,
                    "{}",
                    escapedToken,
                    1
                )
            ),
            ReplaceRecursive(
                substituted,
                tokens,
                i + 1,
                tokenCount
            )
        )
    )
)
```
</details>

| Param     | Value                                                                                                                                                                                                                                          |
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Name      | printf                                                                                                                                                                                                                                         |
| Scope     | Workbook                                                                                                                                                                                                                                       |
| Comment   | printf(mask: str, tokensArray: {array,} \| range \| str ) -> str \| mask: string to substitute tokens into e.g. "Hello {}, {}" or "Hello {2}, {1}" (1-indexed) \| tokensArray: 1D range or array of tokens, e.g. "world" or {"foo","bar"} or A1:A5 |
| Refers To | `=LAMBDA(mask,tokensArray,LET(r,ROWS(tokensArray), c, COLUMNS(tokensArray), length, MAX(r,c), IF(AND(r>1, c>1), "tokensArray must be 1 dimensional", SUBSTITUTE(ReplaceRecursive(mask, tokensArray, 1, length), "\}","}"))))`                  |

```lang-swift
=LAMBDA(
    mask,
    tokensArray,
    LET(
        r,
        ROWS(
            tokensArray
        ),
        c,
        COLUMNS(
            tokensArray
        ),
        length,
        MAX(
            r,
            c
        ),
        IF(
            AND(
                r > 1,
                c > 1
            ),
            "tokensArray must be 1 dimensional",
            SUBSTITUTE(
                ReplaceRecursive(
                    mask,
                    tokensArray,
                    1,
                    length
                ),
                "\}",
                "}"
            )
        )
    )
)
```

---

There will be improvements to Excel's LAMBDA functions that make this easier to write I'm sure, but this recursive approach is good for now I think.


  [1]: https://stackoverflow.com/a/67858844/6609896
  [2]: https://support.microsoft.com/en-us/office/lambda-function-bd212d27-1cd1-4321-a34a-ccbf254b8b67
  [3]: https://i.stack.imgur.com/cyDQ5.png
  [4]: https://i.stack.imgur.com/Dv8DR.png
0
  Epcot Center  

Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks and seasonal special events.

0

testing syntax highlighting issue: test

<html>
<head></head>
<body></body>
</html>
test test test test

thisisblah@gmail.com

1
0

Stack Exchange HLJS Colors

Stacks Color Variable Light Theme Color Dark Theme Color Color Description
--highlight-color
#2f3337

#fff
More or less default text color
(Near Black/ White)
--highlight-comment
#656e77

#999
Grey
--highlight-symbol
#803378

#c59bc1
Magenta
--highlight-keyword
#015692

#88aece
Blue
--highlight-attribute
#015692

#88aece
Blue
--highlight-namespace
#b75501

#f08d49
Orange
--highlight-literal
#b75501

#f08d49
Orange
--highlight-variable
#54790d

#b5bd68
Yellowish-Green
--highlight-punctuation
#535a60

#ccc
Lighter Grey
--highlight-deletion
#c02d2e

#de7176
Red
--highlight-addition
#2f6f44

#76c490
Green

Testing an example link:

Profile for Timothy G. on Stack Exchange, a network of free, community-driven Q&A sites

0
1
3 4 5
6
7

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .