Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Forum Discussion Format/Code does not work
hervé_pipon
Member Posts: 60 ✭✭
Hello,
Find "test: same with code formatting" at the beginning
I'm using Chrome Version 115.0.5790.110
When I want to use Format/Code on the forum, it doesn't work.
See on https://forum.onshape.com/discussion/21555/skfitspline-and-bsplinecurve-controlpoints/Find "test: same with code formatting" at the beginning
I'm using Chrome Version 115.0.5790.110
During Edit I see :

On the Forum it appears like this:

Tagged:
0
Comments
-
It's very buggy and hard to use, but if you create an empty code block first, and then paste into that I think it works. Here's a random FS snippet:
export function convertToMatrix(flatArray, uCount, vCount) { var result = zeroMatrix(uCount, vCount); for (var i = 0; i < uCount; i += 1) { for (var j = 0; j < vCount; j += 1) { result[i][j] = flatArray[i * vCount + j]; } } return result; }Let's see if this works.Simon Gatrall | Product Development, Engineering, Design, Onshape | Ex- IDEO, PCH, Unagi, Carbon | LinkedIn
0 -
It's definitely buggy. You shouldn't have to do this if it just worked, but you can click the top right button to toggle the html view and make sure it didn't add some extra stuff

0 -
S1mon , I read a discussion on this way, and already test it : it doesn't improve.
Evan_Reese I test different way , and the html view toggle doesn't change anything.
For those who want to read the code it is not very pleasant without formatting.
What's weird is that it displays correctly while editing.
0 -
Test of paste, then convert to "code block" :
<div> skFitSpline(sketch1, "spline1", {</div><div> "points" : [</div><div> vector( 0 , 0) * centimeter,</div><div> vector( 100, 100) * centimeter</div><div> ],</div><div> "startDerivative" : vector(150 , 0) * centimeter,</div><div> "endDerivative" : vector(0 , 150) * centimeter,</div><div> });</div>
Test of set to "code block" then paste:<div> skFitSpline(sketch1, "spline1", {</div><div> "points" : [</div><div> vector( 0 , 0) * centimeter,</div><div> vector( 100, 100) * centimeter</div><div> ],</div><div> "startDerivative" : vector(150 , 0) * centimeter,</div><div> "endDerivative" : vector(0 , 150) * centimeter,</div><div> });</div>
0 -
Yeah that didn't work...0
-
a few tests later ,
When I write directly in the editor : it works normally
When I copy paste : it bugs
When I write a simple line of code , and I inspect it inside the code tag the text is:<pre class="CodeBlock"><code>skFitSpline(sketch1, "spline1", {"points" : [</code></pre>
After a copy paste the text is:<pre class="CodeBlock"><code><div>skFitSpline(sketch1, "spline1", {</div><div>"points" : [</div></code></pre>
I seems that some <div> tag where added : I don't know if it is the editor who change the behaviour ?
1 -
If I copy paste from a correctly formatted code on the forum, it works fine
0 -
To make it to work,
you effectivly have to leave the HTML mode-- Once in text mode, you can copy the code; disregard existing text that is no longer properly formatted-- Go back to HTML mode-- Select the pasted code, which is not displayed correctly, but it does not matter-- Apply the Code tagEverything is back to normal
not very user friendly0

