~jpgleeson/spawsh

d1024df4de69fb886509a8101701700a88d8166b — Jack Gleeson 10 months ago a10f438
Work on displaying links in body correctly with just the description if present
1 files changed, 21 insertions(+), 7 deletions(-)

M Program.cs
M Program.cs => Program.cs +21 -7
@@ 526,13 526,27 @@ namespace spawsh
            foreach (string singleLine in LineBuffer) {
                if (singleLine.Length < Console.WindowWidth)
                    {
                        tempBuffer[currentPointer] = singleLine;
                        currentPointer++;
                    }
                    else if (singleLine.Substring(0, 2) == "=>")
                    {
                        //Console.WriteLine(LineBuffer[i]);
                        //out put the link description if possiblr
                        if (singleLine.Length > 2 && singleLine.Substring(0, 2) == "=>")
                        {
                            //Console.WriteLine(LineBuffer[i]);
                            //out put the link description if possiblr
                            string toRemove = "";

                            //break the link line down so we have just the description left
                            //then singleLine = singleLine.Replace(toRemove, "");
                            string linkAndDescription = singleLine.Substring(3);
                            if (linkAndDescription.Contains('\t')) {
                                tempBuffer[currentPointer] = linkAndDescription.Split('\t')[1];
                            } else {
                                toRemove = linkAndDescription.Split(' ')[0];
                                linkAndDescription.Replace(toRemove, "");
                                tempBuffer[currentPointer] = linkAndDescription;
                            }
                            currentPointer++;
                        } else {
                            tempBuffer[currentPointer] = singleLine;
                            currentPointer++;
                        }
                    }
                    else
                    {