Skip to content

Conversation

@christophano
Copy link
Contributor

@christophano christophano commented Jul 16, 2016

Example 003 for Grid Tables has a small error in the expected output.
Input:

+---------+---------+---------+
| Col1    | Col2    | Col3    |
| Col1a   | Col2a   | Col3a   |
| Col1b             | Col3b   |
| Col1c                       |

Should produce:

Col1
Col1a
Col2
Col2a
Col3
Col3a
Col1b Col3b
Col1c

But the spec expects (and currently passes):

Col1
Col1a
Col2
Col2a
Col3
Col3a
Col1b
Col1c

This hides a small bug when cells follow cells with with a colspan.
I've adjusted the way column span is calculated to correct this.
I've also added a property to TableCell called ColumnIndex which records which column a cell belongs to, to make sure alignment is correctly inherited. This property is not used for pipe tables.

// | Col1a | Col2a | Col3a |
// | Col12 | Col3b |
// | Col123 |
// | Col1b | Col3b |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not change directly this file but instead modify the GridTableSpecs.md and then save the Specs.tt file from VS to force the code gen of Specs.cs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh!
Navigated to the specs.cs file from ReSharper test session window, didn't even notice it was generated from T4!

@xoofx
Copy link
Owner

xoofx commented Jul 18, 2016

Good catch!

| Col1a | Col2a | Col3a |
| Col12 | Col3b |
| Col123 |
| Col1b | Col3b |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to regenerate the Specs.cs by saving the tt again (you can amend this commit)

@xoofx
Copy link
Owner

xoofx commented Jul 18, 2016

The build is failing because CommonMark specs changed recently and I was not referencing a specific commit. I will give you the details to fix this later today or tomorrow once I have access to a laptop with WIFI connection! 😅

@christophano
Copy link
Contributor Author

Is that why the specs file that I've regenerated has loads of other changes?

@christophano
Copy link
Contributor Author

christophano commented Jul 18, 2016

Okay, I messed up some of the commits (accidentally rebased from a feature branch and pushed the changes) so I've done a hard reset and forced the changes correctly. Slightly naughty, but cleaner result.
Will await details to fix the broken build later.

@xoofx
Copy link
Owner

xoofx commented Jul 19, 2016

Could you rebase (and not merge) on top of latest master so that you should get a non changing Specs.cs and then amend your last commit to regenerate the cs from tt file? Thanks

@christophano
Copy link
Contributor Author

Done and done. Thanks.

@xoofx xoofx merged commit d57acef into xoofx:master Jul 19, 2016
@xoofx
Copy link
Owner

xoofx commented Jul 19, 2016

Thanks a lot for this fix!

@christophano christophano deleted the bugfix/cell-after-colspan branch July 19, 2016 09:00
@christophano
Copy link
Contributor Author

I also have some work on implementing rowspan for grid tables that I'm testing out. Are you happy to review a pull request when it's ready?

@xoofx
Copy link
Owner

xoofx commented Jul 19, 2016

sure

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

Successfully merging this pull request may close these issues.

2 participants