On this forum: how to correctly include formatting and new lines

I tend to like to put section headers etc into my posts and this forum seems to have the syntax to support that. However; I’m finding that quite often new lines are swallowed after the formatting. How can I use formatting correctly without losing new lines. For example the following input

<strong>Current implementation</strong> 
As is <a href="https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:development">documented</a> the assetmanager takes only the path seperator "/" irrespective of the system.

While this is obviously well documented it was not what I expected, in order to maintain cross system support I have gotten into the habit of writing file paths as following:

[java]
public static final String PATHSEPERATOR=System.getProperty("file.separator");  
location=directory + PATHSEPERATOR + "fileName.png";
[/java]

Obviously this works fine on any system where the local path seperator is "/" but on windows it breaks the assetmanager because on windows the path seperator is  "\". The result is a somewhat confusing exception:


[java]
com.jme3.asset.AssetNotFoundException: assets\Textures\PlayerTooling\emptySlot.png (Flipped) (Mipmapped)
[/java]


When I first started out this exception confused me no end since the file mentioned clearly exists.

<strong>
Request</strong>

<em>Either</em>

Could the assetmanager be altered to accept either the standard "/" file seperator or the local file seperator. This could be achieved by including the following reprocessing function within it

[java]public static final String LOCAL_PATH_SEPERATOR=System.getProperty("file.separator");
public static String reprocessFileLocationForAssetLoader(String in){

            return in.replace(LOCAL_PATH_SEPERATOR , "/");
            
}
[/java]

<em>Or:</em>

Could the assetmanager throw a more understandable exception when an asset string contains the local path sperator instead of "/"

Gives this output:

Current implementation
As is documented the assetmanager takes only the path seperator “/” irrespective of the system.

While this is obviously well documented it was not what I expected, in order to maintain cross system support I have gotten into the habit of writing file paths as following:

[java]
public static final String PATHSEPERATOR=System.getProperty(“file.separator”);
location=directory + PATHSEPERATOR + “fileName.png”;
[/java]

Obviously this works fine on any system where the local path seperator is “/” but on windows it breaks the assetmanager because on windows the path seperator is “”. The result is a somewhat confusing exception:

[java]
com.jme3.asset.AssetNotFoundException: assets\Textures\PlayerTooling\emptySlot.png (Flipped) (Mipmapped)
[/java]

When I first started out this exception confused me no end since the file mentioned clearly exists.

Request

Either

Could the assetmanager be altered to accept either the standard “/” file seperator or the local file seperator. This could be achieved by including the following reprocessing function within it

[java]public static final String LOCAL_PATH_SEPERATOR=System.getProperty(“file.separator”);
public static String reprocessFileLocationForAssetLoader(String in){

        return in.replace(LOCAL_PATH_SEPERATOR , "/");

}
[/java]

Or:

Could the assetmanager throw a more understandable exception when an asset string contains the local path sperator instead of “/”

As you can see the section headings Request and Either are crammed onto a single line along with the paragraphs before and after it

The forum is barely functional in this regard.

I’ve managed to trick the forum into giving me new lines by inserting HTML to make an empty bullet list. It’s painful but it works. I don’t know if that’s restricted for normal users, though.

  • Try
  • Making
  • A bullet list

And see what happens.

1 Like

Bullet list attempt:

  • text
  • text
  • text

using

<ul>
<li>text</li>
<li>text</li>
<li>text</li>
</ul>

New line forced using

<ul></ul>

@pspeed Success!


<strong>Current implementation</strong> 
As is <a href="https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:development">documented</a> the assetmanager takes only the path seperator "/" irrespective of the system.

While this is obviously well documented it was not what I expected, in order to maintain cross system support I have gotten into the habit of writing file paths as following:

[java]
public static final String PATHSEPERATOR=System.getProperty("file.separator");  
location=directory + PATHSEPERATOR + "fileName.png";
[/java]

Obviously this works fine on any system where the local path seperator is "/" but on windows it breaks the assetmanager because on windows the path seperator is  "\". The result is a somewhat confusing exception:


[java]
com.jme3.asset.AssetNotFoundException: assets\Textures\PlayerTooling\emptySlot.png (Flipped) (Mipmapped)
[/java]


When I first started out this exception confused me no end since the file mentioned clearly exists.

<ul></ul>

<strong>
Request</strong>


<ul></ul>

<em>Either</em>


<ul></ul>

Could the assetmanager be altered to accept either the standard "/" file seperator or the local file seperator. This could be achieved by including the following reprocessing function within it

[java]public static final String LOCAL_PATH_SEPERATOR=System.getProperty("file.separator");
public static String reprocessFileLocationForAssetLoader(String in){

            return in.replace(LOCAL_PATH_SEPERATOR , "/");
            
}
[/java]

<em>Or:</em>

Could the assetmanager throw a more understandable exception when an asset string contains the local path sperator instead of "/"

produces

Current implementation
As is documented the assetmanager takes only the path seperator “/” irrespective of the system.

While this is obviously well documented it was not what I expected, in order to maintain cross system support I have gotten into the habit of writing file paths as following:

[java]
public static final String PATHSEPERATOR=System.getProperty(“file.separator”);
location=directory + PATHSEPERATOR + “fileName.png”;
[/java]

Obviously this works fine on any system where the local path seperator is “/” but on windows it breaks the assetmanager because on windows the path seperator is “”. The result is a somewhat confusing exception:

[java]
com.jme3.asset.AssetNotFoundException: assets\Textures\PlayerTooling\emptySlot.png (Flipped) (Mipmapped)
[/java]

When I first started out this exception confused me no end since the file mentioned clearly exists.

    Request

      Either

        Could the assetmanager be altered to accept either the standard “/” file seperator or the local file seperator. This could be achieved by including the following reprocessing function within it

        [java]public static final String LOCAL_PATH_SEPERATOR=System.getProperty(“file.separator”);
        public static String reprocessFileLocationForAssetLoader(String in){

                return in.replace(LOCAL_PATH_SEPERATOR , "/");
        

        }
        [/java]

        Or:

        Could the assetmanager throw a more understandable exception when an asset string contains the local path sperator instead of “/”

        Another thing you can do to keep formatting between code blocks is to use the the non-shift character of ~ instead of the java tag.

        For instance:

        int x = 0;
        x++;

        Line separators are kept.

        Line separators are kept.

        int y = 1;
        y–;

        Line separators are kept.

        Line separators are kept.

        x–;
        y++;