microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.58k stars 906 forks source link

ADS Pipetables not working unless NewLine prior #11126

Open salinsde opened 4 years ago

salinsde commented 4 years ago

Steps to Reproduce:

  1. If the ipynb files has pipe tables. there 'MUST' be a newline prior to the pipetable for the table to show correctly.

Content: Broken content: PG Server life cycle. | req_elastic_server_name | request_id | is_success | latest_state | operation_type | res_upsert_operation_type | min_TIMESTAMP | max_TIMESTAMP | latency | prev_app_name | curr_app_name | control_ring | move_primary_done | move_primary_call_ts | error_message | req_subscription_id | req_resource_group | req_elastic_server_type | req_service_level_objective | req_elastic_server_edition | req_hardware_generation | req_v_core | req_storage_mb | req_version | req_backup_retention_days | req_enforce_ssl | req_enable_storage_auto_grow | req_enable_geo_redundant_backup | req_log_exception_if_not_found | req_src_subscription_id | req_src_resource_group | req_src_elastic_server_type | req_src_elastic_server_name | req_point_in_time | req_replication_role | res_subscription_id | res_resource_group | res_elastic_server_id | res_azure_dns_record_name | res_elastic_server_edition | res_hardware_generation | res_v_core | res_storage_mb | res_version | res_backup_retention_days | res_enforce_ssl | res_enable_storage_auto_grow | res_enable_geo_redundant_backup | res_is_pre_existing_entity | res_user_visible_state | is_recreate_update | |-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-| |

Working:

PG Server life cycle.

| req_elastic_server_name | request_id | is_success | latest_state | operation_type | res_upsert_operation_type | min_TIMESTAMP | max_TIMESTAMP | latency | prev_app_name | curr_app_name | control_ring | move_primary_done | move_primary_call_ts | error_message | req_subscription_id | req_resource_group | req_elastic_server_type | req_service_level_objective | req_elastic_server_edition | req_hardware_generation | req_v_core | req_storage_mb | req_version | req_backup_retention_days | req_enforce_ssl | req_enable_storage_auto_grow | req_enable_geo_redundant_backup | req_log_exception_if_not_found | req_src_subscription_id | req_src_resource_group | req_src_elastic_server_type | req_src_elastic_server_name | req_point_in_time | req_replication_role | res_subscription_id | res_resource_group | res_elastic_server_id | res_azure_dns_record_name | res_elastic_server_edition | res_hardware_generation | res_v_core | res_storage_mb | res_version | res_backup_retention_days | res_enforce_ssl | res_enable_storage_auto_grow | res_enable_geo_redundant_backup | res_is_pre_existing_entity | res_user_visible_state | is_recreate_update | |-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-| |

Does Not Work: This is the Markdown text

image

Displays as

image

Works This is the Markdown corrected

image

Display table Works: image

VasuBhog commented 4 years ago

This issue has the same behavior in VS Code as shown in the screenshot below. If this issue needs to be fixed then please file an issue in VS Code Github.

image

VasuBhog commented 4 years ago

VS Code Issue: https://github.com/microsoft/vscode/issues/102820

rajeshka commented 4 years ago

Seems like ADS issue. Not VSCode. VSCode image ADS image

chlafreniere commented 4 years ago

Ok. Here goes 😄.

vscode doesn't actually use the same markdown renderer that we use everywhere (I was wrong, I believe they used to, but looks like they changed this at some point in the past)... For extensions, vscode actually leverages Markdown-It, which handles this particular case correctly. We actually use the gfm option (GitHub Flavored Markdown) and this isn't being rendered properly using marked.js (the markdown renderer that we leverage for notebooks).

GitHub itself renders the following just fine:

test
|a|b|
|-|-|
test a b

I've created a bug on the markedjs side for this. Hopefully someone can help and we can make a similar change in our repo as well. Some of those regexes are pretty gnarly 😄 .

https://github.com/markedjs/marked/issues/1733